Giter Site home page Giter Site logo

Comments (3)

pwaillette avatar pwaillette commented on July 19, 2024

I have take only the example code. Is it correct ?

from discord.js-selfbot-v13.

aiko-chan-ai avatar aiko-chan-ai commented on July 19, 2024

I have take only the example code. Is it correct ?

oh , i think you forgot something here
user.applications.fetch() returns Promise<Collection>
therefore

const command = application.cache.first();

you need to change it to

const command = application.first();

from discord.js-selfbot-v13.

aiko-chan-ai avatar aiko-chan-ai commented on July 19, 2024

Hello, I don't understand how to send slash commands ? I have an error with the example code :

    const command = application.cache.first();
                                      ^

TypeError: Cannot read properties of undefined (reading 'first')
    at Client.<anonymous> (/Users/aiko/Desktop/Developpement/Projets/JavaScript/Test/index.js:15:39)

My code are :

client.on("message", async (message) => {
  if (message.content === "aaa") {
    const botID = "mudae_id";
    const user = await client.users.fetch(botID);
    const application = await user.applications.fetch();
    console.log(application);
    const command = application.cache.first();
    // Message: Discord.Message, using Message contructor create
    /*
guildID: Guild.id || null,
channelID: Channel.id,
messageID: Message.id,
*/
    await command.sendSlashCommand(message, ["profil"]);
    // Eg: Slash /add role:123456789 user:987654321
    // value: ['123456789', '987654321']
    // Channel.sendSlashCommand(botID, commandName, options): Comming soon !
  }
});

Can you help me, or explain to me how slash commands send work ?

I updated the new slash command usage

from discord.js-selfbot-v13.

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.