You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 6, 2025. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+15-25Lines changed: 15 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,8 @@
1
1
# Discord Command Handler
2
-
A Discord.js Command Handler example using Slash Commands and Context Menus.
2
+
A Discord.js Command Class Handler example using Slash Commands and Context Menus.
3
3
4
4
## Features
5
5
- 🖱 Using Classes
6
-
- 👀 Examples for Top Level, Sub Commands and Sub Command Groups
7
-
- 🔐 Examples for Permissions
8
-
- 👍 Automated Command Creation System
9
6
- ✅ Easy to setup
10
7
- 💻 Stable and 99.9% Bug Free
11
8
@@ -40,31 +37,24 @@ node index
40
37
```
41
38
42
39
## Usage
43
-
### Commands
44
-
This bot is designed to create and handle application commands automatically on start-up (using the `ready` event) which means you do not need to keep manually `set`ting and deploying commands.
45
-
> There is a `clear` command which can let you clear all of the commands easily.
46
40
47
-
48
-
Also, the bot will only create commands for the server, so if you want to have application commands created globally; Replace the following line in `handler/Command.js`:
To create commands, you need to run the following command in the console:
42
+
```bash
43
+
npm run deploy
52
44
```
53
-
with
54
45
55
-
```js
56
-
this.client.application.commands.create(cmd);
57
-
```
58
-
> NOTE: You may need to wait an hour for the commands to create. 200 Global Command Creations per day is the limit.
46
+
These will create a new set of commands in the server.
47
+
48
+
> NOTE: You may need to wait an hour for the commands to create. 200 Command Creates per day is the limit.
59
49
60
50
**Command Folder Structure:**
61
-
-`context` folder contains the Context Menu commands. Change the `type` property to either `USER` or `MESSAGE` to specify the type of context menu. **`description`** must be `null` (using `contextDescription` instead) and `options` must have an empty array `[]`.
62
-
-`general` and other folders are slash commands. The `CHAT_INPUT` type must be used to specify the slash command.
51
+
-`context` folder contains the Context Menu commands.
52
+
-`general` and other folders are slash commands.
63
53
64
54
### Permissions
65
-
Using the `defaultPermission` boolean in your command file, this will determine the permissions for both the Slash and Context Menu commands when the bot starts up (through the `ready` event). The bot may require another restart for it to work properly (even after commands are created).
55
+
Using the `setdefaultPermission` boolean in your command file, this will determine the permissions for both the Slash and Context Menu commands when the bot starts up (through the `ready` event). The bot may require another restart for it to work properly (even after commands are created).
66
56
67
-
> Read more about Application Command Permissions [here](https://discordjs.guide/interactions/slash-command-permissions.html)!
57
+
> Read more about Slash Command Permissions [here](https://discordjs.guide/creating-your-bot/command-handling.html#command-handling)!
If you have found an issue with using this command handler example or have any suggestions? Feel free to join the [NTM Discord Server](https://discord.gg/G2rb53z), send an [issue](https://github.com/NTMNathan/djs-command-handler/issues) or [pull request](https://github.com/NTMNathan/djs-command-handler/pulls). We'll be happy to help and take a look!
0 commit comments