Browse Source

bot: fix logging when updating avatar and display name

Sumner Evans 3 năm trước cách đây
mục cha
commit
6bdeb55724
1 tập tin đã thay đổi với 4 bổ sung3 xóa
  1. 4 3
      bridge/bot.go

+ 4 - 3
bridge/bot.go

@@ -20,8 +20,9 @@ func (b *Bridge) updateBotProfile() {
 				err = b.bot.SetAvatarURL(mxc)
 			}
 		}
-
-		b.log.Warnln("failed to update the bot's avatar: %v", err)
+		if err != nil {
+			b.log.Warnln("failed to update the bot's avatar: ", err)
+		}
 	}
 
 	// Update the bot's display name.
@@ -35,7 +36,7 @@ func (b *Bridge) updateBotProfile() {
 		}
 
 		if err != nil {
-			b.log.Warnln("failed to update the bot's display name: %v", err)
+			b.log.Warnln("failed to update the bot's display name", err)
 		}
 	}
 }