An open API service indexing awesome lists of open source software.

https://github.com/sergiogotuzzo/disgroove

A module to interface with Discord
https://github.com/sergiogotuzzo/disgroove

api bot discord gateway http https rest wrapper

Last synced: 5 months ago
JSON representation

A module to interface with Discord

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)

## 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/sergiogotuzzo/disgroove/tree/main/examples)