mirror of
https://github.com/danbulant/discord.js
synced 2026-07-07 04:00:42 +00:00
Remove VoiceChannel store and add members map
This commit is contained in:
parent
4400eb1b5c
commit
bd50e3c0a5
5 changed files with 7 additions and 24 deletions
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;
|
|
||||||
Loading…
Reference in a new issue