Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only the first button is being clicked using message.clickButton #1119

Open
TSShadowYT opened this issue Apr 1, 2024 · 3 comments
Open

Only the first button is being clicked using message.clickButton #1119

TSShadowYT opened this issue Apr 1, 2024 · 3 comments
Labels
Feature Request a new feature

Comments

@TSShadowYT
Copy link

Which package is the feature request for?

The core library

Feature

I want to click the second or third button but how do i do it?

Ideal solution or implementation

client.on("messageCreate", async (message) => {
if (message.author.id === "438057969251254293" && sit === true) {
const embed = message.embeds[0];
if (embed && embed.footer && embed.footer.text === "ahh") {
await sleep(1000)
try {
await message.clickButton()
} catch(error) {
console.log(chalk.red("Error logged!", error))
}
}
}
}
);

I want to click the second/third button i want to but i cant do it..

Alternative solutions or implementations

No response

Other context

No response

@TSShadowYT TSShadowYT added the Feature Request a new feature label Apr 1, 2024
@TheDevYellowy
Copy link
Contributor

@TSShadowYT
Copy link
Author

/home/container/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/container/node_modules/discord.js-selfbot-v13/src/structures/Message.js:1017:21)
at Client. (/home/container/bot.js:111:21)
at Client.emit (node:events:530:35)
at MessageCreateAction.handle (/home/container/node_modules/discord.js-selfbot-v13/src/client/actions/MessageCreate.js:26:14)
at module.exports [as MESSAGE_CREATE] (/home/container/node_modules/discord.js-selfbot-v13/src/client/websocket/handlers/MESSAGE_CREATE.js:4:32)
at WebSocketManager.handlePacket (/home/container/node_modules/discord.js-selfbot-v13/src/client/websocket/WebSocketManager.js:345:31)
at WebSocketShard.onPacket (/home/container/node_modules/discord.js-selfbot-v13/src/client/websocket/WebSocketShard.js:498:22)
at WebSocketShard.onMessage (/home/container/node_modules/discord.js-selfbot-v13/src/client/websocket/WebSocketShard.js:332:10)
at callListener (/home/container/node_modules/ws/lib/event-target.js:290:14)
at WebSocket.onMessage (/home/container/node_modules/ws/lib/event-target.js:209:9)
@TheDevYellowy

@TheDevYellowy
Copy link
Contributor

I didn't type the code correctly, the X and Y are supposed to be capital like the following

message.clickButton({ X: 1, Y: 0 });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request a new feature
Projects
None yet
Development

No branches or pull requests

2 participants