TelegramBots/Telegram.Bot.Examples

How do i use offset in my code

SecretV opened this issue · 4 comments

hi i want to get the offset but i dont know how! and this is my code till now

    static void Main(string[] args)
    {
        bot.OnUpdate += Bot_OnUpdate;
        bot.StartReceiving();
        Thread.Sleep(int.MaxValue);
    }

    private static void Bot_OnUpdate(object sender, Telegram.Bot.Args.UpdateEventArgs e)
    {
        Console.WriteLine(e.Update.ChannelPost.Text);
    }

What offset?
Do check out the example bot https://telegrambots.github.io/book/1/quickstart.html

@MihaZupan i cant get the messages sent to my bot when my bot is offline , i can only get the messages that has been send to my bot when my bot in online

You will get all available messages when you start the bot. If the downtime is prolonged you are not guaranteed to get any messages from before.
The bot should be "online" all the time to receive messages.

@SecretV Telegram Bot API does not provide any way to access message history. Feel free to join our Telegram.Bot library group.