How to handle multiple tokens.
I have a single file of code. I'd like to run a service where you send a bot token and it runs the code on that bot too. How could i handle that?
discord.js@latest
node.js@latest
11 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Not a discord.js issue? Check out #other-js-ts.
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button!depends on how you are getting that token
you cannot ask users to give you their bot token
no. it's basically my friends whenever they create a server they need a protection bot. so they give me token and i host script on that token
just use the same bot then?
You need a different bot for different servers?
If you have access to these “different tokens” you can simply maintain different env files, and whenever you start the bot you can use Node’s
—env-file
flag to specify the env file to use while running the applicationokay yeah but the point is to use multiple tokens at once
yea if for example you want go have your custom branding
discord is very limited with per-server bot identity
I’ve been doing this the entire time to deploy any of the bots (of course they authorised me to)
Is there a way around to this?!
I actually have the same “white labelling” question as @kama
Makes sense O_O
i'm not asking them. they willingly give it to me. that's why services like crowbots or myself can work around that rule
i see. well my problem still resides in how to run everything on multiple tokens without duplicating my code
I mean I'd say that having a system for that is still against the ToS, it's not like "I have it but I don't recommend using it" is a strong argument
maybe if you make it very, very clear that they're violating the ToS it'll be better
yes. but i want to run them all simultaneously without having to run the code 3x
I guess just put all of them in for loop or something and that’s it. Run a file once to start all of them.