Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while(true)
- {
- const savedMsgId = readVariable("latestMsgId").to!int;
- auto incoming = connection.getUpdates(savedMsgId, 30);
- foreach(ref inc; incoming)
- {
- if(inc.chatId != -1)
- {
- auto chat = createChat(inc);
- if(!inc.message.isNull)
- upsertSubscriber(inc.message.chat.id, inc.message.from);
- try
- chat.dispatch();
- catch(TelegramBotApiException ex)
- {
- logError("TelegramBotApiException: "~ex.msg);
- }
- }
- saveProcessedMessageId(inc.update_id + 1);
- }
- destroy(incoming);
- //~ yield();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement