Adds an action tile to the server side panel View plugins menu.
ui.registerEmbedRenderer(id, contribution)
ui.embeds
Adds an embed renderer.
ui.mountElement(id, request)
ui.dom
Mounts plugin-owned DOM into a target element or selector.
Slash Commands
Slash commands appear in a Discord-style autocomplete menu when a user types / in the chat composer. A command with scope: 'global' (the default) is offered in every chat surface, including direct messages; a command with scope: 'server' only appears while a chat server is active. The user picks a command from the menu (or types it and presses Enter) and the run callback executes with the parsed arguments and the current interaction context.
typePluginApiSlashCommandScope='global'|'server';interfacePluginApiSlashCommandOption{description?: string;name: string;required?: boolean;// 'rest' captures all remaining text; otherwise a single whitespace-delimited token
type?:'string'|'number'|'boolean'|'rest';}interfacePluginApiSlashCommandContextextendsPluginApiActionContext{args: Record<string,string>;// parsed values keyed by option name
command: string;// invoked name without the leading slash
rawArgs: string;// raw text typed after the command name
}interfacePluginApiSlashCommandContribution{description?: string;icon?: string;name: string;options?: PluginApiSlashCommandOption[];run:(context: PluginApiSlashCommandContext)=>Promise<void>|void;scope?: PluginApiSlashCommandScope;}
Method
Capability
Description
commands.register(id, command)
ui.commands
Registers a / slash command for the chat composer.
commands.list()
ui.commands
Lists every slash command currently registered across all plugins.
context.subscriptions.push(api.commands.register('shout',{description:'Shout a message in uppercase',icon:'📢',name:'shout',options:[{name:'message',required: true,type:'rest'}],run:(slash)=>api.messages.send(slash.args.message.toUpperCase()),scope:'server'}));
Context and Logger
Method
Capability
Description
context.getCurrent()
None
Reads current user, server, active text channel, and active voice channel.