TelegramBots / Telegram.Bot.Examples

Examples for the Telegram.Bot C# Library
MIT License
630 stars 289 forks source link

How do i use offset in my code #168

Closed SecretV closed 5 years ago

SecretV commented 5 years ago

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);
    }
MihaZupan commented 5 years ago

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

SecretV commented 5 years ago

@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

MihaZupan commented 5 years ago

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.

karb0f0s commented 5 years ago

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