mirror of
https://github.com/sern-handler/website
synced 2026-06-27 02:02:23 +00:00
1.2 KiB
1.2 KiB
title, sidebar_position
| title | sidebar_position |
|---|---|
| command | 2 |
import GuideFeedback from "../../../../src/components/GuideFeedback";
Commands
Example command
- View the command ping.js in
src/commands. - Make a new file next to ping.js called rps.js
- Copy ping.js contents into rps.js. We base rps.js from ping.js
:::tip The name of your command will be the name of your file. :::
Each slash command will follow this similar structure. In this tutorial, maybe you were smart enough to guess, but we'll be making rock paper scissors!
New command, rock paper scissors
- Instead of CommandType.Both,
typeproperty should be CommandType.Slash- This is to keep it simple. You'll see later, but slash commands work well with message components.
- Give it a description.
- run
npm run commands:publish
Your command should be usable on discord now!
Result
Your command should now look something along the lines of this:
export default commandModule({
type: CommandType.Slash,
description: "I do rps.",
execute: async (ctx) => {
await ctx.reply("Pwease wait. dis command in pwogwess"); // 👻
}
})