f
This commit is contained in:
@@ -4,6 +4,9 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"hal/env"
|
"hal/env"
|
||||||
"hal/handlers"
|
"hal/handlers"
|
||||||
|
"os"
|
||||||
|
"os/signal"
|
||||||
|
"syscall"
|
||||||
|
|
||||||
discordbot "github.com/bwmarrin/discordgo"
|
discordbot "github.com/bwmarrin/discordgo"
|
||||||
)
|
)
|
||||||
@@ -31,6 +34,13 @@ func main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fmt.Println("before .Close")
|
fmt.Println("before .Close")
|
||||||
|
|
||||||
|
// Wait here until CTRL-C or other term signal is received.
|
||||||
|
fmt.Println("Bot is now running. Press CTRL-C to exit.")
|
||||||
|
sc := make(chan os.Signal, 1)
|
||||||
|
signal.Notify(sc, syscall.SIGINT, syscall.SIGTERM, os.Interrupt)
|
||||||
|
<-sc
|
||||||
|
|
||||||
dgclient.Close()
|
dgclient.Close()
|
||||||
|
|
||||||
fmt.Println("after .Close")
|
fmt.Println("after .Close")
|
||||||
|
|||||||
Reference in New Issue
Block a user