mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-18 12:33:30 +01:00
Remove VoiceChannel store and add members map
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -15,7 +15,7 @@ class VoiceStateUpdateHandler extends AbstractHandler {
|
|||||||
if (member) {
|
if (member) {
|
||||||
const oldVoiceChannelMember = cloneObject(member);
|
const oldVoiceChannelMember = cloneObject(member);
|
||||||
if (member.voiceChannel && member.voiceChannel.id !== data.channel_id) {
|
if (member.voiceChannel && member.voiceChannel.id !== data.channel_id) {
|
||||||
member.voiceChannel.store.remove('members', oldVoiceChannelMember);
|
member.voiceChannel.members.delete(oldVoiceChannelMember.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
member.serverMute = data.mute;
|
member.serverMute = data.mute;
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
const GuildChannel = require('./GuildChannel');
|
const GuildChannel = require('./GuildChannel');
|
||||||
const VoiceChannelDataStore = require('./datastore/VoiceChannelDataStore');
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents a Server Voice Channel on Discord.
|
* Represents a Server Voice Channel on Discord.
|
||||||
@@ -8,7 +7,11 @@ const VoiceChannelDataStore = require('./datastore/VoiceChannelDataStore');
|
|||||||
class VoiceChannel extends GuildChannel {
|
class VoiceChannel extends GuildChannel {
|
||||||
constructor(guild, data) {
|
constructor(guild, data) {
|
||||||
super(guild, data);
|
super(guild, data);
|
||||||
this.store = new VoiceChannelDataStore();
|
/**
|
||||||
|
* The members in this Voice Channel.
|
||||||
|
* @type {Map<String, GuildMember>}
|
||||||
|
*/
|
||||||
|
this.members = new Map();
|
||||||
}
|
}
|
||||||
|
|
||||||
setup(data) {
|
setup(data) {
|
||||||
|
|||||||
@@ -1,10 +0,0 @@
|
|||||||
const AbstractDataStore = require('./AbstractDataStore');
|
|
||||||
|
|
||||||
class TextChannelDataStore extends AbstractDataStore {
|
|
||||||
constructor() {
|
|
||||||
super();
|
|
||||||
this.register('messages');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = TextChannelDataStore;
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
const AbstractDataStore = require('./AbstractDataStore');
|
|
||||||
|
|
||||||
class VoiceChannelDataStore extends AbstractDataStore {
|
|
||||||
constructor() {
|
|
||||||
super();
|
|
||||||
this.register('members');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = VoiceChannelDataStore;
|
|
||||||
Reference in New Issue
Block a user