forked from kageru/discord-selphybot
allow for multiple admin users in config (fixes #2)
This commit is contained in:
parent
eb89adc065
commit
fd7a06b56d
@ -15,7 +15,7 @@ type Embed struct {
|
||||
}
|
||||
|
||||
type Config struct {
|
||||
AdminID string
|
||||
Admins []string
|
||||
ServerID string
|
||||
LockedRoleID string
|
||||
Token string
|
||||
|
@ -1,6 +1,9 @@
|
||||
{
|
||||
"Token": "your login token",
|
||||
"AdminID": "your user ID",
|
||||
"Admins": {
|
||||
"your user ID",
|
||||
"another admin ID"
|
||||
},
|
||||
"ServerID": "the server the bot will be running on",
|
||||
"RequireAccept": false,
|
||||
"LockedRoleID": "the role to be given to locked users (readme)",
|
||||
|
@ -43,5 +43,10 @@ func isDM(s *discordgo.Session, m *discordgo.MessageCreate) bool {
|
||||
}
|
||||
|
||||
func isAdmin(u *discordgo.User) bool {
|
||||
return (u.ID == config.AdminID)
|
||||
for _, admin := range config.Admins {
|
||||
if u.ID == admin {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ func getWelcomeEmbed() *discordgo.MessageEmbed {
|
||||
},
|
||||
&discordgo.MessageEmbedField {
|
||||
Name: config.WelcomeEmbed.BugsTitle,
|
||||
Value: fmt.Sprintf(config.WelcomeEmbed.BugsText, config.AdminID),
|
||||
Value: fmt.Sprintf(config.WelcomeEmbed.BugsText, config.Admins[0]),
|
||||
Inline: true,
|
||||
},
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user