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 Session, _ = discordgo.New()
|
||||||
var testPtr = flag.Bool("test", false, "Test mode")
|
var testPtr = flag.Bool("test", false, "Test mode")
|
||||||
|
var bot_token string
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
Session.Token = os.Getenv("DISCORD_TOKEN")
|
if os.Getenv("DISCORD_TOKEN") != "" {
|
||||||
if Session.Token == "" {
|
Session.Token = "Bot " + os.Getenv("DISCORD_TOKEN")
|
||||||
flag.StringVar(&Session.Token, "t", "", "Discord Authentication Token")
|
} else {
|
||||||
|
flag.StringVar(&bot_token, "t", "", "Discord Authentication Token")
|
||||||
|
flag.Parse()
|
||||||
|
Session.Token = "Bot " + bot_token
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue