Skip to content

Commit 431190c

Browse files
committed
fix linter errors
1 parent 46ac473 commit 431190c

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

discord.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,10 @@ func (b *DiscordBot) Connect() {
172172
s.AddHandler(func(s *discordgo.Session, m *discordgo.GuildMemberAdd) {
173173
row := b.Db.QueryRow("SELECT buck_id FROM users WHERE discord_id = ?", m.User.ID)
174174
if row != nil {
175-
b.GiveStudentRole(m.User.ID)
175+
err = b.GiveStudentRole(m.User.ID)
176+
if err != nil {
177+
log.Printf("Unable to add student role to user %v\n", m.User.Username)
178+
}
176179
}
177180
})
178181

@@ -223,12 +226,12 @@ func (b *DiscordBot) Alumnify(discordId string) error {
223226

224227
err := b.Session.GuildMemberRoleRemove(b.GuildId, discordId, b.StudentRoleId)
225228
if err != nil {
226-
return fmt.Errorf("failed to remove student role from alum: %s")
229+
return fmt.Errorf("failed to remove student role from alum: %s", b.StudentRoleId)
227230
}
228231

229232
err = b.Session.GuildMemberRoleAdd(b.GuildId, discordId, b.AlumniRoleId)
230233
if err != nil {
231-
return fmt.Errorf("failed to add student role to alum: %s")
234+
return fmt.Errorf("failed to add student role to alum: %s", b.StudentRoleId)
232235
}
233236

234237
b.Db.Exec("UPDATE Users set alum=1, student=0 WHERE discord_id=?", discordId)

0 commit comments

Comments
 (0)