mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-19 13:03:31 +01:00
feat: use get sticker pack endpoint (#10445)
* feat: use get sticker pack endpoint * fix: mark fetchPack as async * style: resolve eslint warning --------- Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
7
packages/discord.js/typings/index.d.ts
vendored
7
packages/discord.js/typings/index.d.ts
vendored
@@ -1019,7 +1019,8 @@ export class Client<Ready extends boolean = boolean> extends BaseClient {
|
||||
public fetchGuildTemplate(template: GuildTemplateResolvable): Promise<GuildTemplate>;
|
||||
public fetchVoiceRegions(): Promise<Collection<string, VoiceRegion>>;
|
||||
public fetchSticker(id: Snowflake): Promise<Sticker>;
|
||||
public fetchStickerPacks(): Promise<Collection<Snowflake, StickerPack>>;
|
||||
public fetchStickerPacks(options: { packId: Snowflake }): Promise<StickerPack>;
|
||||
public fetchStickerPacks(options?: StickerPackFetchOptions): Promise<Collection<Snowflake, StickerPack>>;
|
||||
/** @deprecated Use {@link Client.fetchStickerPacks} instead. */
|
||||
public fetchPremiumStickerPacks(): ReturnType<Client['fetchStickerPacks']>;
|
||||
public fetchWebhook(id: Snowflake, token?: string): Promise<Webhook>;
|
||||
@@ -1054,6 +1055,10 @@ export class Client<Ready extends boolean = boolean> extends BaseClient {
|
||||
public removeAllListeners<Event extends string | symbol>(event?: Exclude<Event, keyof ClientEvents>): this;
|
||||
}
|
||||
|
||||
export interface StickerPackFetchOptions {
|
||||
packId?: Snowflake;
|
||||
}
|
||||
|
||||
export class ClientApplication extends Application {
|
||||
private constructor(client: Client<true>, data: RawClientApplicationData);
|
||||
public botPublic: boolean | null;
|
||||
|
||||
@@ -208,6 +208,7 @@ import {
|
||||
Poll,
|
||||
ApplicationEmoji,
|
||||
ApplicationEmojiManager,
|
||||
StickerPack,
|
||||
} from '.';
|
||||
import { expectAssignable, expectDeprecated, expectNotAssignable, expectNotType, expectType } from 'tsd';
|
||||
import type { ContextMenuCommandBuilder, SlashCommandBuilder } from '@discordjs/builders';
|
||||
@@ -2587,3 +2588,7 @@ declare const poll: Poll;
|
||||
answerId: 1,
|
||||
});
|
||||
}
|
||||
|
||||
expectType<Collection<Snowflake, StickerPack>>(await client.fetchStickerPacks());
|
||||
expectType<Collection<Snowflake, StickerPack>>(await client.fetchStickerPacks({}));
|
||||
expectType<StickerPack>(await client.fetchStickerPacks({ packId: snowflake }));
|
||||
|
||||
Reference in New Issue
Block a user