diff --git a/commands.go b/commands.go index b45585a..dab7bcb 100644 --- a/commands.go +++ b/commands.go @@ -122,7 +122,7 @@ func getXKCD(s *discordgo.Session, m *discordgo.Message, ctx *mux.Context) { //Restart the bot func restartBot(s *discordgo.Session, m *discordgo.Message, ctx *mux.Context) { - if !checkRole(s, m, ctx, os.Getenv("POCKETBOT_ADMIN_ROLE")) { + if !checkRole(s, m, ctx, bot_admin_role) { resp := "OwO you aren't my daddy..." s.ChannelMessageSend(m.ChannelID, resp) return diff --git a/pocketbot.go b/pocketbot.go index 2ff2df9..df0a091 100644 --- a/pocketbot.go +++ b/pocketbot.go @@ -16,6 +16,7 @@ import ( var Session, _ = discordgo.New() var bot_token string var bot_channel string +var bot_admin_role string var Router = mux.New() func init() { @@ -31,6 +32,9 @@ func init() { if os.Getenv("DISCORD_BOT_CHANNEL") != "" { bot_channel = os.Getenv("DISCORD_BOT_CHANNEL") } + if os.Getenv("POCKETBOT_ADMIN_ROLE") != "" { + bot_admin_role = os.Getenv("POCKETBOT_ADMIN_ROLE") + } } func main() {