Slashasaurus
  • Introduction
  • Quick Start
    • Pages Quick Start
  • Context Menu Commands
  • Interfaces
    • SlashasaurusClientOptions
Powered by GitBook
On this page

Context Menu Commands

Context menu commands are similar to slash commands, but instead of placing them inside the chat folder, you place them inside the message or user folder respectively. Context menu commands also use MessageCommand and UserCommand respectively.

Here's a quick example command:

import { MessageCommand } from 'slashasaurus';

export default new MessageCommand(
  {
    name: 'Mock',
  },
  (interaction, _client) => {
    const content = interaction.targetMessage.content;
    interaction.reply({
      content: content
        .split('')
        .map((letter, index) =>
          index % 2 === 0
            ? letter.toLocaleLowerCase()
            : letter.toLocaleUpperCase()
        )
        .join(''),
      ephemeral: true,
    });
  }
);
PreviousPages Quick StartNextSlashasaurusClientOptions

Last updated 3 years ago