Add function to check member roles
parent
491f28236c
commit
202d852b1b
16
commands.go
16
commands.go
|
@ -10,6 +10,22 @@ import (
|
|||
"strconv"
|
||||
)
|
||||
|
||||
//Check member roles
|
||||
func checkRole(s *discordgo.Session, m *discordgo.Message, ctx *mux.Context, roleid string) bool {
|
||||
if ctx.IsPrivate {
|
||||
return false
|
||||
}
|
||||
channel, _ := s.Channel(m.ChannelID)
|
||||
guild := channel.GuildID
|
||||
member, _ := s.GuildMember(guild, m.Author.ID)
|
||||
for _, role := range member.Roles {
|
||||
if role == roleid {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
//Generate a heckin swear word
|
||||
func getSwear(s *discordgo.Session, m *discordgo.Message, ctx *mux.Context) {
|
||||
resp := ""
|
||||
|
|
Loading…
Reference in New Issue