Comments (8)
Reading the code, I'm not convinced this is accurate.
My theory to the cause was based on the wrapping process. The library literally wraps objects and uses the current client as a param. Figuratively owning the object.
I believe there are other issues resulting in the behaviour I've found, but I've yet to have time to debug further so I reported what I had found so far.
End of the day the lib wasn't written with multi-instancing in mind, so a few changes are required. Shouldn't be too bad, just annoying
But either way we spin it, more testing is needed to determine the cause of the behaviour. As I'll admit, I'm theorising
from naff.
Currently waiting on #346 before more progress can be made here
from naff.
Is there any prio status on this, or labeling? I'm currently having issues making this work as well, there's only one main heartbeater and other instantiations of the client fail to create others respectively. Adding a __new__
magic for this would be very convenient with IPC-based solutions.
from naff.
So, it can be done without to much pain, the downside is there isnt a public method to make it work. Please excuse the ugly test code
tokens = [...]
bots = []
for token in tokens:
_bot = Snake()
bots.append(_bot)
print(f"Logging in with {token}")
loop.run_until_complete(_bot.login(token))
print(_bot.user.username)
print(f"Attempting to start {len(bots)} gateways")
loop.run_until_complete(asyncio.gather(*[b.start_gateway() for b in bots]))
This will create n number of bots and connect them all, however the issue arrises that the bot instances attempt to own listeners, meaning one bot will get all events. In real terms this means if you run a command, one bot will respond twice, meanwhile the other bot wont do anything, this is fixable, but not ideal.
from naff.
could this be sorta monkey-patched by not using @listen() decorators and manually registering them?
from naff.
bot instances attempt to own listeners, meaning one bot will get all events.
Reading the code, I'm not convinced this is accurate.
by not using @listen() decorators and manually registering them?
You'd need to convert them into listeners to register them anyway.
from naff.
Any movement on this?
from naff.
We are now working on this... it is suffering incarnate
from naff.
Related Issues (20)
- Missing docs
- [FEAT] Port Sentry integration from taipan to main library HOT 4
- [FEAT] bot.create_guild()
- [FEAT] Application Command Localization
- [Feat] Support raw strings in Embed.footer HOT 2
- [FEAT] Optional presence/activity cache HOT 2
- [BUG] `Message.reply` fails in DMs + no channel for DMs HOT 1
- [FEAT] Add "delete_after" as (float) param to .send functions.
- [BUG] Caching issue when editing really fast
- [BUG] `GuildVoice.position` is not working as it should HOT 2
- [BUG] Command Syncing HOT 1
- [BUG] bot.is_ready not reset during reconnect
- [FEAT] Add Thread Support for Components HOT 1
- [FEAT] New select menu options
- Bot has exceeded global ratelimit, locking REST API for 0.002 seconds HOT 1
- TypeError: Member.__init__() missing 1 required keyword-only argument: 'joined_at'
- AttributeError: 'NoneType' object has no attribute '_voice_member_ids'
- [FEAT] Modal builder class decorator HOT 1
- [FEAT] Add `Role.clone()` method
- [FEAT] Paginator stuff HOT 2
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 naff.