WebHook发送旧的更新电报机器人

时间:2017-07-23 08:15:00

标签: bots telegram

当我使用WebHook方法时,此方法会发送旧更新。我该如何防止这种情况?

else if (text != null && text.Equals("متن ارسال شود") && (update.Message.Chat.Id == WebApiApplication.chatId1 || update.Message.Chat.Id == WebApiApplication.chatId2)) {
     WebApiApplication.SenderCount = 0;
     int i = 0;
     String[] Array;
     TelBotEntities1 db = new TelBotEntities1();
     int count = db.SenderBots.Count();
     Array = new string[count];
     foreach(var dbItem in db.SenderBots) {
         Array[i] = dbItem.ChannelId;
         i++;
     }

1 个答案:

答案 0 :(得分:0)

Telegram Webhook将自动重新发送失败的更新,您可以通过getWebhookInfo pending_update_count参数查看。

你无法阻止这种情况,只需在启动程序后忽略前几次更新。