1

Fix shutdown, fix broken announces

This commit is contained in:
2019-01-09 03:24:12 +04:00
parent 7612ce778f
commit dca290beb1
4 changed files with 16 additions and 10 deletions

View File

@@ -16,6 +16,8 @@ func fwMessagesFilter(msg *tdlib.TdMessage) bool {
// ZookeeperReceiver adds announcement functionality to bot
func ZookeeperReceiver(client *tdlib.Client) {
// Where to send announces
announcerID := int64(665790161)
log.Debug().Msg("Adding receiver for @FWorldBot messages...")
// Here we can add a receiver to retreive any message type we want
// We like to get UpdateNewMessage events and with a specific FilterFunc
@@ -63,10 +65,13 @@ func ZookeeperReceiver(client *tdlib.Client) {
replyText := battleType + " " + battleTag
reply := tdlib.NewInputMessageText(tdlib.NewFormattedText(replyText, nil), true, true)
_, err := client.SendMessage(updateMsg.Message.ChatID, 0, false, true, nil, reply)
_, err := client.SendMessage(announcerID, 0, false, true, nil, reply)
if err != nil {
log.Error().Err(err)
}
}
<-c.ShutdownDone
return
}
}