disgroove

v1.1.4-dev.e511a6f
An NPM package to interact with the Discord API
discord discord-api discord-wrapper discord.js

disgroove

A module to interface with Discord

Installation

Node.js v18 or newer required

npm install disgroove

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 For support and more join the Discord server

Metadata

  • MIT
  • Whatever
  • XenKys
  • released 8/11/2023

Downloads

Maintainers