Fix shutdown, fix broken announces
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user