-
I want to run a simple script, but without opening the app. let channelId = '' // channel id
for (i = 0; i < 35; i++ ) {
await api.sendMessage(channelId, 'pls daily')
let randomDelay = 86400000 + Math.floor(Math.random() * 10 * 60000)
await delay(randomDelay) // approx 1 day
} Is it possible with this API? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 11 replies
-
Hey, this project uses the Discord console as it's easily usable and CORS-friendly. You could achieve similar functionality using Node.js. EDIT: I added this in a gist, just clone it! git clone https://gist.github.com/6063278cbc9267e7691c084c67176114.git discord-self-bot-console-nodejs
cd discord-self-bot-console-nodejs
npm i Then, in Run with node index.js Initialize a project npm init -y Install node-fetch npm i node-fetch@cjs Copy the script, insert your Discord token at the bottom. Remove lines related to functions used in browser (the Discord client is a browser! Using Electron) discord-self-bot-console/index.js Lines 87 to 100 in 31e687e Add this at the top const fetch = require('node-fetch') Done! ...
var authHeader = 'blablabla'
}
// End of api
// Your script
;(async () => {
let channelId = '' // channel id
for (i = 0; i < 35; i++ ) {
await api.sendMessage(channelId, 'pls daily')
let randomDelay = 86400000 + Math.floor(Math.random() * 10 * 60000)
await delay(randomDelay) // approx 1 day
}
})() Just tested it, it works perfectly ;) |
Beta Was this translation helpful? Give feedback.
-
Still working thru console browser, but not work in nodejs anymore |
Beta Was this translation helpful? Give feedback.
Hey, this project uses the Discord console as it's easily usable and CORS-friendly.
You could achieve similar functionality using Node.js.
EDIT:
I added this in a gist, just clone it!
git clone https://gist.github.com/6063278cbc9267e7691c084c67176114.git discord-self-bot-console-nodejs cd discord-self-bot-console-nodejs npm i
Then, in
index.js
just add your auth token at the bottom and set if the account is a bot or not. Replace the channel id in the script.Run with
Initialize a project
Install node-fetch
Copy the script, insert your Discord token at the bottom.
Remove lines related to functions used in browser (the Discord client is a bro…