diff --git a/src/lib/components/channel/MessageInput.svelte b/src/lib/components/channel/MessageInput.svelte index f9844af5c8..dbf1bf6382 100644 --- a/src/lib/components/channel/MessageInput.svelte +++ b/src/lib/components/channel/MessageInput.svelte @@ -711,6 +711,24 @@ : []), { char: '/', + command: ({ editor, range, props }) => { + if (props?.type === 'prompt') { + void insertTextAtCursor(props.content ?? ''); + return; + } + + editor + .chain() + .focus() + .insertContentAt(range, [ + { + type: 'mention', + attrs: { ...props, mentionSuggestionChar: '/' } + }, + { type: 'text', text: ' ' } + ]) + .run(); + }, render: getSuggestionRenderer(CommandSuggestionList, { i18n, onSelect: (e) => {