Comments (4)
If it is possible could you provide an example with an implementation?
hey it's arandomnewaccount replying by editing (cause my acc is hidden):
Multiple tokens are supported. You'll just have to initialize multiple discum.Client objects:
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.
...
Another edit:
I'll be closing this issue in a few hours unless you have more questions/issues related to this.
from discord-s.c.u.m.
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:
`
with open ('tokens.json') as f:
data= json.load(f)
clients = []
for token in data:
clients.append(discum.Client(token=Tokens))
async def first():
clients.getGuilds()
print("initializing...")
`
When I run this I get the error Token is not defined. Sorry to bother you!
from discord-s.c.u.m.
The formatting is a little messed up sorry.
arandomnewaccount:
no problem. Here's a "fixed" version:
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.
from discord-s.c.u.m.
Thank you so much! That resolved it. Thank you for humoring me. Have a good day!
from discord-s.c.u.m.
Related Issues (20)
- Flashbang Feature
- Trying to pack into a EXE HOT 1
- Question about bot.getProfile
- Fetching members: only getting 14-30% HOT 2
- Sus discum activity when downloaded by using "pip install -r requirements" HOT 1
- Reconnecting makes the bot idle for some reason HOT 1
- on_presence_update don't detect when i change my activity
- Sending Slash Commands in a Guild Channel
- Unable to read content from "ephemeral" messages? HOT 1
- Slash command with an image in inputs
- KeyError in findButton(), Button class
- How can I get a messageID automatically?
- KeyError: 'user' again HOT 1
- Discum + Flask in debug mode
- KeyError: 'user_settings' while setStatus
- member scraping patched
- how to use slash with sub command and input? HOT 2
- How to reply to modals?
- How to boost guild using this library?
- bot.click function not working. Having the issue {"message": "Unknown Application", "code": 10002}' when interacting with buttons.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from discord-s.c.u.m.