1

Fix typos, remove unwanted goroutines

This commit is contained in:
Vladimir Hodakov 2019-01-08 06:51:36 +04:00
parent 66638518ea
commit a98179a6ed
Signed by: Vladimir Hodakov
GPG Key ID: 673980B6882F82C6

View File

@ -16,12 +16,12 @@ func fwMessagesFilter(msg *tdlib.TdMessage) bool {
// ZookeeperReceiver adds announcement functionality to bot // ZookeeperReceiver adds announcement functionality to bot
func ZookeeperReceiver(client *tdlib.Client) { func ZookeeperReceiver(client *tdlib.Client) {
log.Debug().Msg("Adding receiver for @FWorld_bot messages...") log.Debug().Msg("Adding receiver for @FWorldBot messages...")
// Here we can add a receiver to retreive any message type we want // Here we can add a receiver to retreive any message type we want
// We like to get UpdateNewMessage events and with a specific FilterFunc // We like to get UpdateNewMessage events and with a specific FilterFunc
receiver := client.AddEventReceiver(&tdlib.UpdateNewMessage{}, fwMessagesFilter, 5) receiver := client.AddEventReceiver(&tdlib.UpdateNewMessage{}, fwMessagesFilter, 5)
log.Debug().Msg("Receiver added") log.Debug().Msg("Receiver added")
go func() {
for newMsg := range receiver.Chan { for newMsg := range receiver.Chan {
updateMsg := (newMsg).(*tdlib.UpdateNewMessage) updateMsg := (newMsg).(*tdlib.UpdateNewMessage)
// Check if message text contains needed battle data // Check if message text contains needed battle data
@ -69,5 +69,4 @@ func ZookeeperReceiver(client *tdlib.Client) {
} }
} }
} }
}()
} }