diff --git a/command.go b/command.go index 7e6c5d5..7d1f3cf 100644 --- a/command.go +++ b/command.go @@ -249,8 +249,16 @@ func echoMessage(s *discordgo.Session, m *discordgo.MessageCreate) { } func giveAgeRole(s *discordgo.Session, m *discordgo.MessageCreate) { - Member, _ := s.GuildMember(config.ServerID, m.Author.ID) - dm, _ := s.UserChannelCreate(Member.User.ID) + Member, err := s.GuildMember(config.ServerID, m.Author.ID) + if err != nil { + log.Printf("User could not be retrieved for role assignment\n%s", err) + return + } + dm, err := s.UserChannelCreate(Member.User.ID) + if err != nil { + log.Printf("Could not reply to user\n%s", err) + return + } required := mapset.NewSetWith("416184227672096780", "416184208470310922", "416184150404628480", "416184132473847810", "440996904948465664") for command, role := range config.RoleCommands { if m.Content == command {