Comments (2)
Okay, I investigated a little bit about this on my side.
I've found an easy way to reproduce this:
- Open Discord twice with the same account (eg. PC + navigator, PC + Smartphone…)
- On Device 1, connect to any vocal channel.
- It will trigger a VoiceStateUpdate with session_id A (so Device 1 = Session ID A), and it'll be added to
state.voice_states
andstate.guild[guild_id].voice_states
- Without disconnecting device 1, on Device 2, connect to any vocal channel from the same server (Same channel as device 1 or not, it doesn't matter).
- It will trigger a VoiceStateUpdate with session_id B (Device 2 = Session ID B), which will be added to the two same hashmaps.
- No VoiceStateUpdate will be triggered with the old disconnected session A.
=> Theself.voice_states
now contains a wrong entry. It will only be removed if the user connects using device 1 (session A) again later (or by restarting the bot).
I think we should use user_id
rather than session_id
for voice_states
keys, as a same user can't be vocally connected twice from two devices.
I'll try to make a PR to fix this issue.
from disco.
This is a "quick&easy" fix which does not broke the voice_states
management.
imo, we should completly replace session_id
key by user_id
but as it could broke some bots, and as I don't know if you're agree with me, I made this first.
from disco.
Related Issues (20)
- Python 3.7 support HOT 4
- How do I change the config to trigger commands with "!" ? HOT 2
- Authentication error but missing config.json HOT 1
- OSError with music example bot when requesting to play an url. HOT 3
- TypeError on update_prescence() HOT 4
- Add ability for Plugin subclasses HOT 3
- Does this library support voice? HOT 2
- TypeError when passing youtubedl bufferedopus object through to player HOT 4
- Bounty: Documentation HOT 4
- installation command error : Command errored out with exit status 1: HOT 5
- error when running in Python 2.7 HOT 1
- Python 3.8 Support HOT 1
- Tutorial doesn't work HOT 3
- Missing license HOT 1
- Newer release on pypi HOT 4
- new discord API HOT 2
- Setting Bot Activity
- append new events HOT 2
- Is this still maintained/developed? HOT 5
- Documentation Site Problem
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 disco.