Archived
1

Inline commands support (needed for pins handling)

This commit is contained in:
2017-11-26 07:55:13 +04:00
parent fed4a52075
commit a6811f61fc
4 changed files with 62 additions and 7 deletions

View File

@@ -56,13 +56,18 @@ func main() {
updates, _ := c.Bot.GetUpdatesChan(u)
for update := range updates {
if update.Message == nil || update.Message.From == nil {
continue
} else if update.Message.Date < (int(time.Now().Unix()) - 1) {
// Ignore old messages
if update.Message != nil {
if update.Message.From != nil {
if update.Message.Date > (int(time.Now().Unix()) - 5) {
c.Router.RouteRequest(&update)
}
}
} else if update.InlineQuery != nil {
c.Router.RouteInline(&update)
} else if update.ChosenInlineResult != nil {
c.Log.Debug(update.ChosenInlineResult.ResultID)
} else {
continue
}
c.Router.RouteRequest(&update)
}
}