How to click components? (Buttons) #15
Replies: 2 comments 1 reply
-
I don't know about this bot. My script does not let you listen to events, but you can periodically look at new messages and find what you want. Idk what you mean by {
id()
const channelId = cid
var loop = true
// A set used to make sure we don't look at an already-treated messages
const seenMessages = new Set()
while (loop) {
const messages = await api.getMessages(channelId)
const found = messages.filter(x => x.content.includes('frick off karen') && !seenMessages.has(x.id))
if (found.length > 0) {
for (const aMessage of found) {
if (!loop) break
seenMessages.add(aMessage.id)
console.log(`Start hit ${aMessage.id}`)
// Hit 5 times and wait 2s each time
for (let i = 0; i < 5; i++) {
if (!loop) break
console.log(`Hit ${i} ${aMessage.id}`)
await api.addReaction(channelId, aMessage.id, '👍') // Change with the good reaction
await delay(2000)
}
}
}
await delay(30000)
}
} EDIT: For button components, idk how it works as it's a new feature, maybe have a check there https://discord.com/developers/docs/interactions/receiving-and-responding#responding-to-an-interaction |
Beta Was this translation helpful? Give feedback.
1 reply
-
Can you try my code? @Kaden-Skinner |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm doing something with dank memer and every so randomly it sends a "event" life
frick off karen
and I have to press it until karen gets to either 1 hp or 0 hpis that possible
Beta Was this translation helpful? Give feedback.
All reactions