Merge pull request #3460 from matrix-org/t3chguy/room_avatar
Add roomavatar slash command to set avatar of the current roompull/21833/head
commit
46e0a7cafa
|
@ -259,6 +259,24 @@ export const CommandMap = {
|
|||
category: CommandCategories.actions,
|
||||
}),
|
||||
|
||||
roomavatar: new Command({
|
||||
name: 'roomavatar',
|
||||
args: '[<mxc_url>]',
|
||||
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: '[<mxc_url>]',
|
||||
|
|
|
@ -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",
|
||||
|
|
Loading…
Reference in New Issue