Move bot admin role to be a global variable.
parent
c2142bb741
commit
be4b4e06de
|
@ -122,7 +122,7 @@ func getXKCD(s *discordgo.Session, m *discordgo.Message, ctx *mux.Context) {
|
||||||
|
|
||||||
//Restart the bot
|
//Restart the bot
|
||||||
func restartBot(s *discordgo.Session, m *discordgo.Message, ctx *mux.Context) {
|
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..."
|
resp := "OwO you aren't my daddy..."
|
||||||
s.ChannelMessageSend(m.ChannelID, resp)
|
s.ChannelMessageSend(m.ChannelID, resp)
|
||||||
return
|
return
|
||||||
|
|
|
@ -16,6 +16,7 @@ import (
|
||||||
var Session, _ = discordgo.New()
|
var Session, _ = discordgo.New()
|
||||||
var bot_token string
|
var bot_token string
|
||||||
var bot_channel string
|
var bot_channel string
|
||||||
|
var bot_admin_role string
|
||||||
var Router = mux.New()
|
var Router = mux.New()
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
@ -31,6 +32,9 @@ func init() {
|
||||||
if os.Getenv("DISCORD_BOT_CHANNEL") != "" {
|
if os.Getenv("DISCORD_BOT_CHANNEL") != "" {
|
||||||
bot_channel = 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() {
|
func main() {
|
||||||
|
|
Loading…
Reference in New Issue