I want to run a script like this one below multiple times at the same time but using different tokens for each time, for which I already have a list of tokens.
The question is, how do I get to run this script n number of times (number of tokens), at the same time?
I have tried threading, but it didn't work, most likely due to the async functions (for which I don't have much experience). I have also tried having all the script inside one function with the token as a parameter, but the async functions were preventing it somehow, as well?
Is there some way doing this using subprocess, or such?
import module
client = module.Client()
async def on_some_event():
do_something_using_current_client_token
def ask_for_something():
return something
ask_for_something()
client.run(token)
Thank you.