You can receive channel posts and channel post editing.
But you won't receive it in OnMessage
event, you can receive it from OnUpdate
as Message
object like code below:
Note: The bot must be an administrator in the channel.
private static readonly TelegramBotClient Bot = new TelegramBotClient("my-real-token");
public static void Main(string[] args)
{
Bot.StartReceive(UpdateType.ChannelPost, UpdateType.EditedChannelPost);
Bot.OnUpdate += Bot_OnUpdate;
}
public static void OnUpdate(UpdateEventArgs e)
{
if (e.Update.Type == UpdateType.ChannelPost)
{
Message post = e.Update.ChannelPost;
//TODO: Store channel post
}
else if (e.Update.Type == UpdateType.EditedChannelPost)
{
Message editedPost = e.Update.EditedChannelPost;
//TODO: Store edited channel post
}
}