https://github.com/agenthackeryt/discord-slash.js
https://github.com/agenthackeryt/discord-slash.js
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/agenthackeryt/discord-slash.js
- Owner: AgentHackerYT
- License: mit
- Created: 2021-12-30T21:09:28.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-01-04T13:42:32.000Z (over 4 years ago)
- Last Synced: 2025-03-09T11:32:00.176Z (over 1 year ago)
- Language: JavaScript
- Size: 6.84 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# discord-slash.js
- Easy To Use
# How To Use
- Create A Dir (i created a Dir/Folder and Named It commands)
- Now Copy This Code
```js
const { Client, Intents } = require("discord.js")
const client = new Client({ intents: [Intents.FLAGS.GUILDS] })
const { SlashCommands } = require("discord-slash.js")
const commands = new SlashCommands({
client: client,
dir: "commands"
})
```
- Now Go To Commands Dir and Create A Folder Which Will Be Our Command File
- Example Command / Ping Command
```js
module.exports = {
name: "ping",
description: "ping Command",
run: async(i, client) =>{
i.reply({content: "Pong"})
}
}
```
- Use .register Function To Register The Command
```js
commands.register()
```
- Then Use .handle Function To Handle The Commands
```js
commands.handle()
```
- Or If You Want Addtional Parms to be added to Commands
```js
commands.handle(parms1, parms2)
```
- To Delete All Commands Use .deleteAll Function
```js
commands.deleteAll()
```
- To Delete A Particular Command Use .delete Function
```js
commands.delete(name)
```
- Add A Single Command use .registerSingleCommand Function
```js
commands.registerSingleCommand({name: "some-name", description: "Some Description"})
```
# Credits
- Developed By Agent Hacker
- Discord : Agent Hacker#0477