diff --git a/command.go b/command.go index 1b37043..6886a69 100644 --- a/command.go +++ b/command.go @@ -164,6 +164,7 @@ func generateReply(message *discordgo.MessageCreate, command *Command) string { Any message passed to this method will be redirected to config.ModChannel. This is useful for anonymous complaints or similar messages. */ +// TODO: refactor this and the next into a more general redirect function func redirectComplaint(s *discordgo.Session, m *discordgo.MessageCreate) { embed := &discordgo.MessageEmbed{ Author: &discordgo.MessageEmbedAuthor{}, @@ -202,7 +203,7 @@ func giveAgeRole(s *discordgo.Session, m *discordgo.MessageCreate) { // but working around it is not actually necessary for performance and makes the code uglier in other places. for _, newRole := range config.RoleCommands { for _, curRole := range Member.Roles { - // If the user already has one of the available roles, tell him and exit + // If the user already has one of the available roles, tell them and exit if newRole == curRole { if curRole == role { // User is trying to get the role they already have @@ -217,8 +218,8 @@ func giveAgeRole(s *discordgo.Session, m *discordgo.MessageCreate) { } } log.Printf("Giving Role %s to %s", roleName(s.State, role), userToString(m.Author)) - s.ChannelMessageSend(dm.ID, "Haaai, Ryoukai desu~") s.GuildMemberRoleAdd(config.ServerID, m.Author.ID, role) + s.ChannelMessageSend(dm.ID, "Haaai, Ryoukai desu~") } } }