Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(Invite): add type #10280

Merged
merged 1 commit into from
Jun 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading