Fix shutdown, fix broken announces
This commit is contained in:
@@ -78,14 +78,14 @@ func Connect() {
|
||||
log.Debug().Msg("Connection with Telegram established")
|
||||
for update := range rawUpdates {
|
||||
log.Debug().Msgf("Update of type %s received", update.Data["@type"])
|
||||
|
||||
<-c.ShutdownDone
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// Shutdown disconnects from Telegram
|
||||
func Shutdown() {
|
||||
_, err := client.Destroy()
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msg("Failed to destroy Telegram client instance")
|
||||
}
|
||||
client.DestroyInstance()
|
||||
log.Info().Msg("Connection with Telegram closed")
|
||||
}
|
||||
|
Reference in New Issue
Block a user