Force using a bot token.
parent
0c0204caa2
commit
944d6137d4
10
buttsbot.go
10
buttsbot.go
|
@ -12,11 +12,15 @@ import (
|
|||
|
||||
var Session, _ = discordgo.New()
|
||||
var testPtr = flag.Bool("test", false, "Test mode")
|
||||
var bot_token string
|
||||
|
||||
func init() {
|
||||
Session.Token = os.Getenv("DISCORD_TOKEN")
|
||||
if Session.Token == "" {
|
||||
flag.StringVar(&Session.Token, "t", "", "Discord Authentication Token")
|
||||
if os.Getenv("DISCORD_TOKEN") != "" {
|
||||
Session.Token = "Bot " + os.Getenv("DISCORD_TOKEN")
|
||||
} else {
|
||||
flag.StringVar(&bot_token, "t", "", "Discord Authentication Token")
|
||||
flag.Parse()
|
||||
Session.Token = "Bot " + bot_token
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue