Git Product home page Git Product logo

Comments (10)

davipatricio avatar davipatricio commented on May 26, 2024 1

@Vexcited you can see some examples in discord.js guide: https://deploy-preview-674--discordjs-guide.netlify.app/interactions/buttons.html

from discord.js-light.

timotejroiko avatar timotejroiko commented on May 26, 2024

It will be added once discord.js commits the PR to master. Right now its still an unfinished draft so it might take a while.

from discord.js-light.

davipatricio avatar davipatricio commented on May 26, 2024

Are you able to add buttons support to djs light as per the djs update?

Released and now supported by discord.js-light πŸŽ‰

from discord.js-light.

V1rtuaI avatar V1rtuaI commented on May 26, 2024

Next up support for Eris library? πŸ₯ΊπŸ₯Ί

from discord.js-light.

Vexcited avatar Vexcited commented on May 26, 2024

How do you add buttons ?
When I want to use discord-buttons, I need to bypass the version of Discord like this

const { version } = require("discord.js");
const Discord = require("discord.js-light");
Discord.version = version;

or else I got a error saying that .\v3\Classes doesn't exist.

But now I get a new error:

Error: The class/prototype returned from the extender function must extend the existing structure class/prototype (received function ExtendedTextChannel extends TextChannel; expected extension of ExtendedTextChannel).
    at Function.extend (C:\Users\vexit\Documents\GitHub\rikka-discord\node\node_modules\discord.js\src\util\Structures.js:82:13)
    at module.exports (C:\Users\vexit\Documents\GitHub\rikka-discord\node\node_modules\discord-buttons\src\index.js:22:16)    
    at Object.runCommand (C:\Users\vexit\Documents\GitHub\rikka-discord\node\src\core\command-handler\command-handler.js:185:40)
    at module.exports (C:\Users\vexit\Documents\GitHub\rikka-discord\node\src\core\event-handler\events\message.js:115:46)    
    at processTicksAndRejections (internal/process/task_queues.js:95:5)

and here is my code:

const buttons = require("discord-buttons")(client);
// The button is from discord-buttons examples.
const button = new buttons.MessageButton()
			.setStyle("red")
			.setLabel("My First Button!")
			.setID("click_to_function")
			.setDisabled();

So why ? Please πŸ˜₯😭

from discord.js-light.

timotejroiko avatar timotejroiko commented on May 26, 2024

you will need to fork discord-buttons and replace all require("discord.js") with require("discord.js-light") in their v12 classes folder, because they are trying to extend the base discord.js classes instead of the already extended discord.js-light classes.

Not sure what else could be done, discord-buttons was not made to be compatible with djs-light.

from discord.js-light.

Vexcited avatar Vexcited commented on May 26, 2024

Okay ; Sorry for the troubles, but in fact I made a mistake.

In my command handler I've wrote that

const buttons = require("discord-buttons")(client);

well it was only

const buttons = require("discord-buttons");

The only modification I need to do is to backup the real discord.js package version with this

const { version } = require("discord.js");
const Discord = require("discord.js-light");
Discord.version = version;

Sorry, but thanks too !

from discord.js-light.

DomeQdev avatar DomeQdev commented on May 26, 2024

@Vexcited please use official discord.js version of buttons. https://discord.js.org/#/docs/main/master/class/MessageButton

from discord.js-light.

Vexcited avatar Vexcited commented on May 26, 2024

@DomeQdev ; How do I do that ? Can I have one example please 😭 ?

from discord.js-light.

timotejroiko avatar timotejroiko commented on May 26, 2024

this is now supported in v4, so im gonna go ahead and close this

from discord.js-light.

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.