Skip to content

Commit

Permalink
fix(Channel): ensure partial DMChannels get created (#3954)
Browse files Browse the repository at this point in the history
  • Loading branch information
izexi authored Mar 17, 2020
1 parent a36a65b commit 8c0a940
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions src/structures/Channel.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,17 +100,12 @@ class Channel extends Base {
const Structures = require('../util/Structures');
let channel;
if (!data.guild_id && !guild) {
switch (data.type) {
case ChannelTypes.DM: {
const DMChannel = Structures.get('DMChannel');
channel = new DMChannel(client, data);
break;
}
case ChannelTypes.GROUP: {
const PartialGroupDMChannel = require('./PartialGroupDMChannel');
channel = new PartialGroupDMChannel(client, data);
break;
}
if ((data.recipients && data.type !== ChannelTypes.GROUP) || data.type === ChannelTypes.DM) {
const DMChannel = Structures.get('DMChannel');
channel = new DMChannel(client, data);
} else if (data.type === ChannelTypes.GROUP) {
const PartialGroupDMChannel = require('./PartialGroupDMChannel');
channel = new PartialGroupDMChannel(client, data);
}
} else {
guild = guild || client.guilds.cache.get(data.guild_id);
Expand Down

0 comments on commit 8c0a940

Please sign in to comment.