diff --git a/server/chat-commands/avatars.tsx b/server/chat-commands/avatars.tsx index 2ed91570dc3f9..ca236a481e648 100644 --- a/server/chat-commands/avatars.tsx +++ b/server/chat-commands/avatars.tsx @@ -686,15 +686,18 @@ export const commands: Chat.ChatCommands = { return false; } - user.avatar = avatar; - if (user.id in customAvatars && !avatar.endsWith('xmas')) { - Avatars.setDefault(user.id, avatar); + this.runBroadcast(); + if (!this.broadcasting) { + user.avatar = avatar; + if (user.id in customAvatars && !avatar.endsWith('xmas')) { + Avatars.setDefault(user.id, avatar); + } } - if (!silent) { - this.sendReply( - `${this.tr`Avatar changed to:`}\n` + - Chat.html`|raw|${Avatars.img(avatar)}` - ); + if (!silent || this.broadcasting) { + if (!this.broadcasting) { + this.sendReply(`${this.tr`Avatar changed to:`}`); + } + this.sendReply(Chat.html`|raw|${Avatars.img(avatar)}`); if (OFFICIAL_AVATARS_BELIOT419.has(avatar)) { this.sendReply(`|raw|(${this.tr`Artist: `}Beliot419)`); } @@ -727,7 +730,10 @@ export const commands: Chat.ChatCommands = { } } }, - avatarhelp: [`/avatar [avatar name or number] - Change your trainer sprite.`], + avatarhelp: [ + `/avatar [avatar name or number] - Change your trainer sprite.`, + `!avatar [avatar name or number] - Show the specified trainer sprite and credits. Requires: + % @ # ~`, + ], avatars(target, room, user) { this.runBroadcast();