Replies: 1 comment
-
function beep() {
const context = new AudioContext();
const oscillator = context.createOscillator();
oscillator.type = "sine";
oscillator.frequency.value = 800;
oscillator.connect(context.destination);
oscillator.start();
setTimeout(() => oscillator.stop(), 1200);
}
{
id()
const search = 'mange'
const channelId = cid
const seenMessagesIds = new Set()
var loop = true
while (loop) {
const messages = await api.getMessages(cid, 100)
const found = messages.filter(msg => msg.content.includes(search) && !seenMessagesIds.has(msg.id))
if (found.length > 0) {
beep()
for (const msg of found) {
console.log(`Found message ID=${msg.id} "${msg.content}" by ${msg.author.username}#${msg.author.discriminator} ID=${msg.author.id}`)
seenMessagesIds.add(msg.id)
await api.addReaction(msg.channel_id, msg.id, '🤔')
}
}
await api.delay(15000) // wait 15s
}
} |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
rigwild
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Originally posted by @FourAstro in #28 (reply in thread)
Beta Was this translation helpful? Give feedback.
All reactions