Can i message in certain channels on certain MULTIPLE servers, automatically repeating on a clock #25
Answered
by
rigwild
otomegitsune
asked this question in
Q&A
-
Can i message in certain channels on certain MULTIPLE servers, automatically repeating on a clock (and make the clock vary between certain values so it looks human) |
Beta Was this translation helpful? Give feedback.
Answered by
rigwild
Jul 16, 2022
Replies: 1 comment
-
Every 15-20 minutes, publish in channels successively. You can do {
let channelIds = [
'123454811846377545',
'123452640322166785',
'123455417791856651',
'123455417791856652',
'123455417791856653'
]
let messages = [
'hello',
'hi',
'wesh',
'yo',
'hey',
'mdr',
'suce',
'ntm',
'fdp',
'yolo',
'trop baisé',
'mange tes morts'
]
var loop = true
while (loop) {
for (const channelId of channelIds) {
// Send a randomly picked message
let message = messages[Math.floor(Math.random() * messages.length)]
await api.sendMessage(channelId, message)
console.log(`Sent message "${message}" to channel ${channelId}`)
await delay(1000)
}
// Wait for 15 minutes + random max 5 minutes (from 15 to 20 minutes)
await delay(15 * 60 * 1000 + Math.floor(Math.random() * 5 * 60 * 1000))
}
} Mark reply as answer if it's ok |
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
Every 15-20 minutes, publish in channels successively. You can do
loop = false
to stop.