diff --git a/src/SlashCommands.js b/src/SlashCommands.js index 2d5617f8f0..21c837030b 100644 --- a/src/SlashCommands.js +++ b/src/SlashCommands.js @@ -259,6 +259,24 @@ export const CommandMap = { category: CommandCategories.actions, }), + roomavatar: new Command({ + name: 'roomavatar', + args: '[]', + description: _td('Changes the avatar of the current room'), + runFn: function(roomId, args) { + let promise = Promise.resolve(args); + if (!args) { + promise = singleMxcUpload(); + } + + return success(promise.then((url) => { + if (!url) return; + return MatrixClientPeg.get().sendStateEvent(roomId, 'm.room.avatar', {url}, ''); + })); + }, + category: CommandCategories.actions, + }), + myroomavatar: new Command({ name: 'myroomavatar', args: '[]', diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index f55eff0aff..7ca31a0f94 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -156,6 +156,7 @@ "Upgrade": "Upgrade", "Changes your display nickname": "Changes your display nickname", "Changes your display nickname in the current room only": "Changes your display nickname in the current room only", + "Changes the avatar of the current room": "Changes the avatar of the current room", "Changes your avatar in this current room only": "Changes your avatar in this current room only", "Changes your avatar in all rooms": "Changes your avatar in all rooms", "Gets or sets the room topic": "Gets or sets the room topic",