mirror of
https://github.com/danbulant/discord.js
synced 2026-06-08 17:21:31 +00:00
fix(Channel): ensure partial DMChannels get created (#3954)
This commit is contained in:
parent
a36a65b36a
commit
8c0a940cdb
1 changed files with 6 additions and 11 deletions
|
|
@ -100,17 +100,12 @@ class Channel extends Base {
|
||||||
const Structures = require('../util/Structures');
|
const Structures = require('../util/Structures');
|
||||||
let channel;
|
let channel;
|
||||||
if (!data.guild_id && !guild) {
|
if (!data.guild_id && !guild) {
|
||||||
switch (data.type) {
|
if ((data.recipients && data.type !== ChannelTypes.GROUP) || data.type === ChannelTypes.DM) {
|
||||||
case ChannelTypes.DM: {
|
const DMChannel = Structures.get('DMChannel');
|
||||||
const DMChannel = Structures.get('DMChannel');
|
channel = new DMChannel(client, data);
|
||||||
channel = new DMChannel(client, data);
|
} else if (data.type === ChannelTypes.GROUP) {
|
||||||
break;
|
const PartialGroupDMChannel = require('./PartialGroupDMChannel');
|
||||||
}
|
channel = new PartialGroupDMChannel(client, data);
|
||||||
case ChannelTypes.GROUP: {
|
|
||||||
const PartialGroupDMChannel = require('./PartialGroupDMChannel');
|
|
||||||
channel = new PartialGroupDMChannel(client, data);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
guild = guild || client.guilds.cache.get(data.guild_id);
|
guild = guild || client.guilds.cache.get(data.guild_id);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue