https://github.com/xenkys/disgroove
A module to interface with Discord
https://github.com/xenkys/disgroove
api bot discord gateway http https rest wrapper
Last synced: over 1 year ago
JSON representation
A module to interface with Discord
- Host: GitHub
- URL: https://github.com/xenkys/disgroove
- Owner: XenKys
- License: mit
- Created: 2023-07-22T19:48:10.000Z (almost 3 years ago)
- Default Branch: dev
- Last Pushed: 2025-01-24T20:57:05.000Z (over 1 year ago)
- Last Synced: 2025-02-24T21:06:01.021Z (over 1 year ago)
- Topics: api, bot, discord, gateway, http, https, rest, wrapper
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/disgroove
- Size: 1.41 MB
- Stars: 9
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# disgroove
A module to interface with Discord
- Fast
- Lightweight
- Flexible
- 100% coverage of the [Official Discord API Documentation](https://discord.com/developers/docs/intro)
## Installation
[**Node.js v18**](https://nodejs.org) or newer required
```
npm install disgroove
```
## Example
```js
const {
Client,
GatewayIntents,
InteractionType,
InteractionCallbackType,
MessageFlags,
} = require("disgroove");
const client = new Client("B0t.T0k3N");
client.once("ready", () => {
console.log("Logged in as", client.user.username);
client.createGlobalApplicationCommand(client.application.id, {
name: "ping",
description: "Pong!",
});
});
client.on("interactionCreate", async (interaction) => {
if (interaction.type !== InteractionType.ApplicationCommand) return;
if (interaction.data.name === "ping") {
client.createInteractionResponse(interaction.id, interaction.token, {
type: InteractionCallbackType.ChannelMessageWithSource,
data: {
content: "Pong! 🏓",
flags: MessageFlags.Ephemeral,
},
});
}
});
client.connect();
```
More examples on the [GitHub repository](https://github.com/XenKys/disgroove/tree/main/examples)
For support and more join the [Discord server](https://discord.gg/kunfRQgRyD)