1
0
mirror of https://github.com/mgerb/go-discord-bot synced 2026-01-11 17:42:48 +00:00

wip ui for pubg

This commit is contained in:
2017-08-02 23:26:39 -05:00
parent 84c2425c6d
commit e425ada97e
10 changed files with 216 additions and 19 deletions

View File

@@ -39,18 +39,22 @@ func Connect(token string) {
// Start - blocking function that starts a websocket listenting for discord callbacks
func Start() {
// Open the websocket and begin listening.
err := Session.Open()
if err != nil {
fmt.Println("error opening connection,", err)
// start new non blocking go routine
go func() {
// Open the websocket and begin listening.
err := Session.Open()
if err != nil {
fmt.Println("error opening connection,", err)
return
}
fmt.Println("Bot is now running...")
// Simple way to keep program running until CTRL-C is pressed.
<-make(chan struct{})
return
}
fmt.Println("Bot is now running...")
// Simple way to keep program running until CTRL-C is pressed.
<-make(chan struct{})
return
}()
}
func AddHandler(handler interface{}) {