Slight adjustments to comments

This commit is contained in:
kageru 2019-01-13 11:37:44 +01:00
parent 4566ffc230
commit 9dd7775168

View File

@ -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~")
}
}
}