-
-
Notifications
You must be signed in to change notification settings - Fork 167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Help: Multi token support? #22
Comments
If it is possible could you provide an example with an implementation? hey it's arandomnewaccount replying by editing (cause my acc is hidden): bot0 = discum.Client(token='user0')
bot1 = discum.Client(token='user1')
bot2 = discum.Client(token='user2') I suppose if you had a large list of tokens and you wanted to automatically initialize clients for all of them, you could like this: clients = []
for token in tokenlist:
clients.append(discum.Client(token=token)) and then do clients[some_index_idk].sendMessage(...) or whatever function you're using. ... |
Sorry to reopen this, I don't really understand how to implement this. I am trying to import tokens from a json file and want to automatically initialize it. RIght now I have this: clients = [] When I run this I get the error Token is not defined. Sorry to bother you! |
The formatting is a little messed up sorry. arandomnewaccount: with open('tokens.json') as f:
data= json.load(f)
print("initializing...")
clients = []
for token in data:
clients.append(discum.Client(token=token)) Now, I'm not entirely sure about your "clients.getGuilds()" line since clients is a list (see code above). If you'd like to get the guilds a client is in, you'll have to connect to the websocket and then do clients[some_index].gateway.session.guildIDs. Lemme know if that helps. |
Thank you so much! That resolved it. Thank you for humoring me. Have a good day! |
Hi! Are multiple tokens supported? If not that seems like a relatively simple thing to implement.
The text was updated successfully, but these errors were encountered: