#does anyone know why Im getting this error? class sendAPICallback extends dAPIMessage {

1 messages · Page 1 of 1 (latest)

trim sky
#

1: that ^ is supposed to be shown in a monospace font

#

2: probably circular dependency. show more info

pastel gyro
#
class sendAPICallback extends dAPIMessage {
                              ^

TypeError: Class extends value undefined is not a constructor or null
    at Object.<anonymous> (C:\Users\Brandon Nguyen\Desktop\DiscordBot\node_modules\discord-buttons\src\v12\Classes\APIMessage.js:7:31)```
#

@trim sky

trim sky
#

have you imported dAPIMessage?

pastel gyro
#

i dont think so, how would i do that?

trim sky
#

the same way you import any other file. i assume your project has multiple files

pastel gyro
#

yes a bunch of files

#

i would like to avoid rewriting if all possible lol

#

its been like 12 days straight I've been writing this

trim sky
#

oh, just now I seen, the error doesn't happen in your code

#

looks like discord-buttons is not properly installed

pastel gyro
#

how would i go about properly install installing that? just npm install discord-buttons?

trim sky
#

the library is deprecated, so i suggest you to migrate first, before trying to fix any problems

pastel gyro
#

how would i migrate?

trim sky
pastel gyro
#

i just installed the necessary packages people said and started writing

trim sky
#

i'm not sure, but this lib may let you make buttons of different colors? if you don't care about that, then you should just ignore the lib

#

docs are your best guides

pastel gyro
#

i've been looking and the closest answer i found is to rollback discord.js to 12.5.3 but then i run code and it says 12 is no longer supported and i need v13

trim sky
#

the deprecation message provides a server

#

i think you should join there and ask, since they know better stuff about the library

peak cove
#

@pastel gyro stop using discord-buttons

#

djs has buttons build in

scenic widgetBOT
#

We do not provide any help with third party libraries like discord-buttons.
• Discord.js supports buttons natively: guide

trim sky
#

@peak cove can you please give me an example on how you set a different color in current v13?

trim sky
#

of the button

#

of a MessageButton

scenic widgetBOT
trim sky
#

yes, but it takes a number? is that supposed to be the hex?

peak cove
#

it takes a number or a messagebuttonstyle which is a string

#

the number is just to get the string of the enum

trim sky
#

ah, i see, so that library was just masking SUCCESS and DANGER with red and green

peak cove
#

wut

#

there are only like 5 styles you can set

#

you can't change the style to anything else

trim sky
#

the library uses the following syntax: .setStyle("red")

peak cove
#

red is not a valid style

#

no

trim sky
#

exactly what i was saying

#

red is actually DANGER

peak cove
#

yes

trim sky
#

@pastel gyro, removing the lib altogether shouldn't be a problem, since the syntax is similar in discord.js. you just have to change a thing or two

pastel gyro
#

i got discord-buttons deleted but not im getting another error lol

peak cove
pastel gyro
#

const got = require("got");

peak cove
#

wat

#

"got" is definitely nowhere near djs related

pastel gyro
# peak cove wat

im getting this now Error [DISALLOWED_INTENTS]: Privileged intent provided is not enabled or whitelisted.
at WebSocketManager.createShards (C:\Users\Brandon Nguyen\Desktop\DiscordBot\node_modules\discord.js\src\client\websocket\WebSocketManager.js:250:15)