Giter Site home page Giter Site logo

Comments (8)

yassine955 avatar yassine955 commented on June 11, 2024

I have seen on this Documentation https://discordjs.guide/interactions/registering-slash-commands.html#guild-commands, but did Discord Akairo already implement this?

from discord-akairo.

SerenModz21 avatar SerenModz21 commented on June 11, 2024

make sure u have the GUILD_INTEGRATIONS intent

from discord-akairo.

yassine955 avatar yassine955 commented on June 11, 2024

I have the GUILD_INTEGRATIONS

from discord-akairo.

yassine955 avatar yassine955 commented on June 11, 2024
public constructor(config: BotOptions) {
    super(
      {
        ownerID: config.owners,
      },
      {
        intents: [
          Intents.FLAGS.GUILDS,
          Intents.FLAGS.GUILD_MESSAGES,
          Intents.FLAGS.GUILD_INTEGRATIONS,
        ],
      }
    );
    this.config = config;
  }

from discord-akairo.

rizzdev avatar rizzdev commented on June 11, 2024

@yassine955

Hi, sorry to pop in on an unrelated subject, but how did you use esm imports? I am getting an error when I try to do that.

https://i.imgur.com/HcsrsUC.jpeg

from discord-akairo.

SerenModz21 avatar SerenModz21 commented on June 11, 2024
public constructor(config: BotOptions) {
    super(
      {
        ownerID: config.owners,
      },
      {
        intents: [
          Intents.FLAGS.GUILDS,
          Intents.FLAGS.GUILD_MESSAGES,
          Intents.FLAGS.GUILD_INTEGRATIONS,
        ],
      }
    );
    this.config = config;
  }

I'm not sure, it should be working, u might have to try and do some debugging to see if u can figure out what is happening

from discord-akairo.

SerenModz21 avatar SerenModz21 commented on June 11, 2024

@yassine955

Hi, sorry to pop in on an unrelated subject, but how did you use esm imports? I am getting an error when I try to do that.

https://i.imgur.com/HcsrsUC.jpeg

they are using typescript, for javascript you would have to google it

i know babel or swc can be used but looking at the node docs (https://nodejs.org/api/esm.html) it looks like u can use the .mjs file extension to ue them

from discord-akairo.

Syrup avatar Syrup commented on June 11, 2024

The interactionCreate is not triggering, when I type /ping in discord. The other event like messageCreate works fine, anyone has a solution?

import { Listener } from "discord-akairo";
import { Interaction, MessageActionRow, MessageButton } from "discord.js";

export default class interactionCreate extends Listener {
  public constructor() {
    super("interactionCreate", {
      emitter: "client",
      event: "interactionCreate",
      category: "client",
    });
  }

  public async exec(interaction: Interaction) {
    if (!interaction.isCommand()) return;

    if (interaction.commandName === "ping") {
      const row = new MessageActionRow().addComponents(
        new MessageButton()
          .setCustomId("primary")
          .setLabel("Primary")
          .setStyle("PRIMARY")
      );

      await interaction.reply({ content: "Pong!", components: [row] });
    }
  }
}

try changing import { Interaction, ... } from "discord.js" to import { CommandInteraction, ... } from "discord.js"
see https://discord.js.org/#/docs/main/stable/class/CommandInteraction

from discord-akairo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.