diff --git a/commands.go b/commands.go index 175b48b..3fae3ea 100644 --- a/commands.go +++ b/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 := ""