Skip to content

Commit

Permalink
feat(Invite): add type
Browse files Browse the repository at this point in the history
  • Loading branch information
sdanialraza committed Jun 2, 2024
1 parent 3b5c600 commit 6dba37f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/discord.js/src/structures/Invite.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ class Invite extends Base {

constructor(client, data) {
super(client);

/**
* The type of this invite
* @type {InviteType}
*/
this.type = data.type;

this._patch(data);
}

Expand Down
5 changes: 5 additions & 0 deletions packages/discord.js/src/util/APITypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,11 @@
* @see {@link https://discord-api-types.dev/api/discord-api-types-v10/enum/InteractionResponseType}
*/

/**
* @external InviteType
* @see {@link https://discord-api-types.dev/api/discord-api-types-v10/enum/InviteType}
*/

/**
* @external InviteTargetType
* @see {@link https://discord-api-types.dev/api/discord-api-types-v10/enum/InviteTargetType}
Expand Down
2 changes: 2 additions & 0 deletions packages/discord.js/typings/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ import {
APIPollAnswer,
APISelectMenuDefaultValue,
SelectMenuDefaultValueType,
InviteType,
} from 'discord-api-types/v10';
import { ChildProcess } from 'node:child_process';
import { EventEmitter } from 'node:events';
Expand Down Expand Up @@ -1990,6 +1991,7 @@ export class Invite extends Base {
public targetUser: User | null;
public targetType: InviteTargetType | null;
public temporary: boolean | null;
public type: InviteType;
public get url(): string;
public uses: number | null;
public delete(reason?: string): Promise<Invite>;
Expand Down

0 comments on commit 6dba37f

Please sign in to comment.