mirror of
https://github.com/danbulant/discord.js
synced 2026-06-19 22:51:32 +00:00
Webpack build for branch data-store-refactor: bdb4ee395a73bf78aacec9c4cf91215456dc730e
This commit is contained in:
parent
7eb2f8e909
commit
cbb0776283
1 changed files with 3 additions and 32 deletions
|
|
@ -25583,36 +25583,9 @@ const TextChannel = __webpack_require__(56);
|
|||
const VoiceChannel = __webpack_require__(57);
|
||||
const Constants = __webpack_require__(0);
|
||||
|
||||
class UserStore extends DataStore {
|
||||
class ChannelStore extends DataStore {
|
||||
create(data, emitEvent = true) {
|
||||
super.create();
|
||||
/* A
|
||||
const already = this.client.channels.has(data.id);
|
||||
let channel;
|
||||
if (data.type === Constants.ChannelTypes.DM) {
|
||||
channel = new DMChannel(this.client, data);
|
||||
} else if (data.type === Constants.ChannelTypes.GROUP_DM) {
|
||||
channel = new GroupDMChannel(this.client, data);
|
||||
} else {
|
||||
guild = guild || this.client.guilds.get(data.guild_id);
|
||||
if (guild) {
|
||||
if (data.type === Constants.ChannelTypes.TEXT) {
|
||||
channel = new TextChannel(guild, data);
|
||||
guild.channels.set(channel.id, channel);
|
||||
} else if (data.type === Constants.ChannelTypes.VOICE) {
|
||||
channel = new VoiceChannel(guild, data);
|
||||
guild.channels.set(channel.id, channel);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (channel) {
|
||||
if (this.pastReady && !already) this.client.emit(Constants.Events.CHANNEL_CREATE, channel);
|
||||
this.client.channels.set(channel.id, channel);
|
||||
return channel;
|
||||
}
|
||||
*/
|
||||
|
||||
if (this.has(data.id)) return this.get(data.id);
|
||||
let channel;
|
||||
switch (data.type) {
|
||||
|
|
@ -25632,9 +25605,7 @@ class UserStore extends DataStore {
|
|||
|
||||
this.set(channel.id, channel);
|
||||
|
||||
if (channel && emitEvent) {
|
||||
this.client.emit(Constants.Events.CHANNEL_CREATE, channel);
|
||||
}
|
||||
if (channel && emitEvent) this.client.emit(Constants.Events.CHANNEL_CREATE, channel);
|
||||
|
||||
return channel;
|
||||
}
|
||||
|
|
@ -25649,7 +25620,7 @@ class UserStore extends DataStore {
|
|||
}
|
||||
}
|
||||
|
||||
module.exports = UserStore;
|
||||
module.exports = ChannelStore;
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
|
|
|||
Loading…
Reference in a new issue