A long functioning feature of my bot no longer works. Buttons of a message can no longer be clicked. Seems like the button is not properly found on the message, and so the button is undefined causing errors.
Additionally the wrong error message is displaying.
/home/dev/backend/node_modules/discord.js-selfbot-v13/src/structures/Message.js:1017
button = button.toJSON();
^
TypeError: Cannot read properties of undefined (reading 'toJSON')
at Message.clickButton (/home/dev/backend/node_modules/discord.js-selfbot-v13/src/structures/Message.js:1017:21)
at /home/dev/backend/routes/router.js:250:13
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
A trival modification of moving the .toJSON() call down a line
returns the correct error.
/home/dev/backend/node_modules/discord.js-selfbot-v13/src/structures/Message.js:1018
if (!button) throw new TypeError('BUTTON_NOT_FOUND');
^
TypeError: BUTTON_NOT_FOUND
at Message.clickButton (/home/dev/backend/node_modules/discord.js-selfbot-v13/src/structures/Message.js:1018:24)
at /home/dev/backend/routes/router.js:251:13
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Code sample
const channel = client.channels.cache.get("1103168663617556571")
console.log(targetmessage)
const message = await channel.messages.fetch(request.body.message_id)
#yes I confirmed messages.fetch is finding a valid message with button components.
message.clickButton({ row: 0, col: 0})
#error here
Package version
├── discord.js-selfbot-v13@3.1.4
Node.js version
v20.9.0
Operating system
No response
Priority this issue should have
Medium (should be fixed soon)
Checklist
[X] I have searched the open issues for duplicates.
[X] I have shared the entire traceback.
[X] I am using a user token (and it isn't visible in the code).
Which package has the bugs?
The core library
Issue description
A long functioning feature of my bot no longer works. Buttons of a message can no longer be clicked. Seems like the button is not properly found on the message, and so the button is undefined causing errors.
Additionally the wrong error message is displaying.
A trival modification of moving the .toJSON() call down a line
returns the correct error.
Code sample
Package version
├── discord.js-selfbot-v13@3.1.4
Node.js version
v20.9.0
Operating system
No response
Priority this issue should have
Medium (should be fixed soon)
Checklist
Additional Information
Sorry If this issue sucks. First time I made one.