Add roomavatar slash command to set avatar of the current room
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
e18b38c409
commit
2632e648b4
1 changed files with 18 additions and 0 deletions
|
@ -259,6 +259,24 @@ export const CommandMap = {
|
||||||
category: CommandCategories.actions,
|
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(this.props.roomId, 'm.room.avatar', {url}, '');
|
||||||
|
}));
|
||||||
|
},
|
||||||
|
category: CommandCategories.actions,
|
||||||
|
}),
|
||||||
|
|
||||||
myroomavatar: new Command({
|
myroomavatar: new Command({
|
||||||
name: 'myroomavatar',
|
name: 'myroomavatar',
|
||||||
args: '[<mxc_url>]',
|
args: '[<mxc_url>]',
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue