fix: friend invite
This commit is contained in:
parent
7dd33bd946
commit
bbe0399245
@ -523,7 +523,7 @@ class Client extends BaseClient {
|
||||
*/
|
||||
|
||||
/**
|
||||
* Join this Guild using this invite
|
||||
* Join this Guild / GroupDMChannel using this invite
|
||||
* @param {InviteResolvable} invite Invite code or URL
|
||||
* @param {AcceptInviteOptions} [options={ bypassOnboarding: true, bypassVerify: true }] Options
|
||||
* @returns {Promise<Guild|DMChannel|GroupDMChannel>}
|
||||
@ -614,7 +614,7 @@ class Client extends BaseClient {
|
||||
}
|
||||
return guild;
|
||||
} else {
|
||||
return this.channels.cache.has(i.channelId);
|
||||
return this.channels.cache.has(i.channelId || data.channel?.id);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -193,16 +193,16 @@ class Invite extends Base {
|
||||
if ('channel_id' in data) {
|
||||
/**
|
||||
* The channel's id this invite is for
|
||||
* @type {Snowflake}
|
||||
* @type {?Snowflake}
|
||||
*/
|
||||
this.channelId = data.channel_id;
|
||||
this.channel = this.client.channels.cache.get(data.channel_id);
|
||||
}
|
||||
|
||||
if ('channel' in data) {
|
||||
if ('channel' in data && data.channel !== null) {
|
||||
/**
|
||||
* The channel this invite is for
|
||||
* @type {Channel}
|
||||
* @type {?Channel}
|
||||
*/
|
||||
this.channel ??= this.client.channels._add(data.channel, this.guild, { cache: false });
|
||||
this.channelId ??= data.channel.id;
|
||||
|
4
typings/index.d.ts
vendored
4
typings/index.d.ts
vendored
@ -1728,8 +1728,8 @@ export class InteractionWebhook extends PartialWebhookMixin() {
|
||||
|
||||
export class Invite extends Base {
|
||||
private constructor(client: Client, data: RawInviteData);
|
||||
public channel: NonThreadGuildBasedChannel | GroupDMChannel;
|
||||
public channelId: Snowflake;
|
||||
public channel?: NonThreadGuildBasedChannel | GroupDMChannel;
|
||||
public channelId?: Snowflake;
|
||||
public code: string;
|
||||
public readonly deletable: boolean;
|
||||
public readonly createdAt: Date | null;
|
||||
|
Loading…
Reference in New Issue
Block a user