Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zomoxyz/discordslash
https://github.com/zomoxyz/discordslash
Last synced: 13 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/zomoxyz/discordslash
- Owner: ZomoXYZ
- License: isc
- Created: 2022-03-29T23:23:44.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-01-17T01:28:53.000Z (12 months ago)
- Last Synced: 2024-11-07T18:18:25.283Z (2 months ago)
- Language: TypeScript
- Size: 85.9 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# discordslash
Discord Application Commands made easy
## usage
run `npm run buildexample ` to compile example(s)
`examples/main.ts`
```ts
import { Client, CommandInteraction, Intents } from 'discord.js';
import { addCommand, CommandGenerator, CommandOptionGenerator, initClient } from '../';const client = new Client({ intents: [Intents.FLAGS.GUILDS] });
initClient(client);
addCommand([
new CommandGenerator()
.setName('ping')
.setDescription('ping me')
.setRun((interaction: CommandInteraction) =>
interaction.reply('pong')),
new CommandGenerator()
.setName('8ball')
.setDescription('ask the magic 8ball a question')
.addOption('question', 'string', 'question to ask the 8ball', true)
.setRun(EightBall)
]);client.login(TOKEN);
```## TODO
- quick option functions
- non global commmands