@biggy1337/discord-sbjs 1.3.11 → 1.3.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@biggy1337/discord-sbjs",
3
- "version": "1.3.11",
3
+ "version": "1.3.12",
4
4
  "description": "An unofficial discord.js fork for creating selfbots",
5
5
  "main": "./src/index.js",
6
6
  "types": "./typings/index.d.ts",
@@ -26,10 +26,14 @@ class VoiceStateManager extends CachedManager {
26
26
 
27
27
  _add(data, cache = true) {
28
28
  const existing = this.cache.get(data.user_id);
29
- if (existing) return existing._patch(data);
29
+ if (existing) {
30
+ const entry = existing._patch(data);
31
+ if (data.channel_id === null) this.cache.delete(data.user_id);
32
+ return entry;
33
+ }
30
34
 
31
35
  const entry = new this.holds(this.guild, data);
32
- if (cache) this.cache.set(data.user_id, entry);
36
+ if (cache && data.channel_id !== null) this.cache.set(data.user_id, entry);
33
37
  return entry;
34
38
  }
35
39