mirror of
https://github.com/danbulant/discord.js
synced 2026-07-06 11:40:41 +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 VoiceChannel = __webpack_require__(57);
|
||||||
const Constants = __webpack_require__(0);
|
const Constants = __webpack_require__(0);
|
||||||
|
|
||||||
class UserStore extends DataStore {
|
class ChannelStore extends DataStore {
|
||||||
create(data, emitEvent = true) {
|
create(data, emitEvent = true) {
|
||||||
super.create();
|
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);
|
if (this.has(data.id)) return this.get(data.id);
|
||||||
let channel;
|
let channel;
|
||||||
switch (data.type) {
|
switch (data.type) {
|
||||||
|
|
@ -25632,9 +25605,7 @@ class UserStore extends DataStore {
|
||||||
|
|
||||||
this.set(channel.id, channel);
|
this.set(channel.id, channel);
|
||||||
|
|
||||||
if (channel && emitEvent) {
|
if (channel && emitEvent) this.client.emit(Constants.Events.CHANNEL_CREATE, channel);
|
||||||
this.client.emit(Constants.Events.CHANNEL_CREATE, channel);
|
|
||||||
}
|
|
||||||
|
|
||||||
return channel;
|
return channel;
|
||||||
}
|
}
|
||||||
|
|
@ -25649,7 +25620,7 @@ class UserStore extends DataStore {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = UserStore;
|
module.exports = ChannelStore;
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue