disgroove
TypeScript icon, indicating that this package has built-in type declarations

2.2.6 • Public • Published

disgroove

A module to interface with Discord

Example

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

Package Sidebar

Install

npm i disgroove

Weekly Downloads

26

Version

2.2.6

License

MIT

Unpacked Size

702 kB

Total Files

140

Last publish

Collaborators

  • cicciofrollo