Skip to content

Commit

Permalink
Update main.go
Browse files Browse the repository at this point in the history
  • Loading branch information
andersfylling authored Feb 21, 2020
1 parent 0b361f3 commit 6d09e7b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/examples/bot-with-msg-self-delete/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ func main() {
}

func run(client *disgord.Client) {
// connect and disconnect on system interrupt
defer client.StayConnectedUntilInterrupted(context.Background())

mdlw, err := NewMiddlewareHolder(client, context.Background())
if err != nil {
panic(err)
Expand All @@ -35,6 +32,9 @@ func run(client *disgord.Client) {
mdlw.filterOutHumans,
mdlw.filterOutOthersMsgs,
autoDeleteNewMessages)

// connect now, and disconnect on system interrupt
client.StayConnectedUntilInterrupted(context.Background())
}

//////////////////////////////////////////////////////
Expand Down

0 comments on commit 6d09e7b

Please sign in to comment.