click button discord js v13

17 Views Asked by At
async function myFunction() {
const channel = client.channels.cache.get(channelID);
if (channel) {
    const messages = await channel.messages.fetch({ limit: 1 });
    for (const message of messages.values()) {
        const result = message.content;
        if (result.includes("1️⃣")) {

        }
    }
}

} this is my code I want to check if the result contains buttons, including button number 1, then click on that button

i try to try with buttons[i].click() but it doesn't work.

0

There are 0 best solutions below