diff --git a/src/SlashCommands.tsx b/src/SlashCommands.tsx index 403ecf5772..80fc98f97d 100644 --- a/src/SlashCommands.tsx +++ b/src/SlashCommands.tsx @@ -1305,19 +1305,17 @@ export const Commands = [ description: effect.description(), args: '', runFn: function(roomId, args) { - return success((async () => { - if (!args) { - args = effect.fallbackMessage(); - MatrixClientPeg.get().sendEmoteMessage(roomId, args); - } else { - const content = { - msgtype: effect.msgType, - body: args, - }; - MatrixClientPeg.get().sendMessage(roomId, content); - } - dis.dispatch({ action: `effects.${effect.command}` }); - })()); + let content: IContent; + if (!args) { + content = ContentHelpers.makeEmoteMessage(effect.fallbackMessage()); + } else { + content = { + msgtype: effect.msgType, + body: args, + }; + } + dis.dispatch({ action: `effects.${effect.command}` }); + return successSync(content); }, category: CommandCategories.effects, renderingTypes: [TimelineRenderingType.Room], diff --git a/src/components/views/rooms/EditMessageComposer.tsx b/src/components/views/rooms/EditMessageComposer.tsx index 9a0e4d1ea8..83c494bca7 100644 --- a/src/components/views/rooms/EditMessageComposer.tsx +++ b/src/components/views/rooms/EditMessageComposer.tsx @@ -337,7 +337,7 @@ class EditMessageComposer extends React.Component