File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 )
You can’t perform that action at this time.
0 commit comments