mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-13 18:13:29 +01:00
feat(Widget): wrapper for widget.json (#5619)
Co-authored-by: monbrey <rsm999@uowmail.edu.au> Co-authored-by: BannerBomb <BannerBomb55@gmail.com> Co-authored-by: SpaceEEC <spaceeec@yahoo.com> Co-authored-by: Antonio Román <kyradiscord@gmail.com> Co-authored-by: Noel <icrawltogo@gmail.com>
This commit is contained in:
39
typings/index.d.ts
vendored
39
typings/index.d.ts
vendored
@@ -350,6 +350,7 @@ declare module 'discord.js' {
|
||||
public fetchGuildTemplate(template: GuildTemplateResolvable): Promise<GuildTemplate>;
|
||||
public fetchVoiceRegions(): Promise<Collection<string, VoiceRegion>>;
|
||||
public fetchWebhook(id: Snowflake, token?: string): Promise<Webhook>;
|
||||
public fetchWidget(id: Snowflake): Promise<Widget>;
|
||||
public generateInvite(options?: InviteGenerationOptions): string;
|
||||
public login(token?: string): Promise<string>;
|
||||
public sweepMessages(lifetime?: number): number;
|
||||
@@ -2028,6 +2029,34 @@ declare module 'discord.js' {
|
||||
public once(event: string, listener: (...args: any[]) => Awaited<void>): this;
|
||||
}
|
||||
|
||||
export class Widget extends Base {
|
||||
constructor(client: Client, data: object);
|
||||
private _patch(data: object): void;
|
||||
public fetch(): Promise<Widget>;
|
||||
public id: Snowflake;
|
||||
public instantInvite?: string;
|
||||
public channels: Collection<Snowflake, WidgetChannel>;
|
||||
public members: Collection<string, WidgetMember>;
|
||||
public presenceCount: number;
|
||||
}
|
||||
|
||||
export class WidgetMember extends Base {
|
||||
constructor(client: Client, data: object);
|
||||
public id: string;
|
||||
public username: string;
|
||||
public discriminator: string;
|
||||
public avatar?: string;
|
||||
public status: PresenceStatus;
|
||||
public deaf?: boolean;
|
||||
public mute?: boolean;
|
||||
public selfDeaf?: boolean;
|
||||
public selfMute?: boolean;
|
||||
public suppress?: boolean;
|
||||
public channelID?: Snowflake;
|
||||
public avatarURL: string;
|
||||
public activity?: WidgetActivity;
|
||||
}
|
||||
|
||||
//#endregion
|
||||
|
||||
//#region Collections
|
||||
@@ -3861,6 +3890,16 @@ declare module 'discord.js' {
|
||||
$device?: string;
|
||||
}
|
||||
|
||||
interface WidgetActivity {
|
||||
name: string;
|
||||
}
|
||||
|
||||
interface WidgetChannel {
|
||||
id: Snowflake;
|
||||
name: string;
|
||||
position: number;
|
||||
}
|
||||
|
||||
type WSEventType =
|
||||
| 'READY'
|
||||
| 'RESUMED'
|
||||
|
||||
Reference in New Issue
Block a user