Skip to content
This repository has been archived by the owner on Oct 28, 2020. It is now read-only.

Commit

Permalink
bot: send client hello when bot restarts
Browse files Browse the repository at this point in the history
  • Loading branch information
sarisia committed Apr 27, 2020
1 parent 82450c8 commit 6fc5be8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions aria/bot.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,11 @@ func (b *bot) run(parent context.Context) {
cancel() // TODO: not good
}()

// send client_hello
go b.sendAriaRequest(&request{
OP: "hello",
})

wg.Wait()
}

Expand Down Expand Up @@ -274,6 +279,7 @@ func (b *bot) onMessage(s *discordgo.Session, m *discordgo.MessageCreate) {
func (b *bot) sendAriaRequest(r *request) {
select {
case <-time.After(CHAN_TIMEOUT):
log.Printf("failed to send Aria request: %s\n", r.OP)
case b.ariaSend <- r:
}
}
Expand Down

0 comments on commit 6fc5be8

Please sign in to comment.