Add plain text command

This commit is contained in:
Ajay Bura 2022-09-11 12:18:32 +05:30
parent 5848c02d50
commit bca00f46a9
3 changed files with 33 additions and 17 deletions

View file

@ -38,7 +38,7 @@ const commands = {
exe: (roomId, data, onSuccess) => {
const body = data.trim();
if (body === '') return;
onSuccess(body, 'm.emote');
onSuccess(body, { msgType: 'm.emote' });
},
},
shrug: {
@ -46,9 +46,18 @@ const commands = {
description: 'Send ¯\\_(ツ)_/¯ as message',
exe: (roomId, data, onSuccess) => onSuccess(
`¯\\_(ツ)_/¯${data.trim() !== '' ? ` ${data}` : ''}`,
'm.text',
{ msgType: 'm.text' },
),
},
plain: {
name: 'plain',
description: 'Send plain text message',
exe: (roomId, data, onSuccess) => {
const body = data.trim();
if (body === '') return;
onSuccess(body, { msgType: 'm.text', autoMarkdown: false });
},
},
help: {
name: 'help',
description: 'View all commands',