UNPKG

seyfert

Version:

The most advanced framework for discord bots

46 lines (45 loc) 2.29 kB
import type { BaseCDNUrlOptions } from '../api'; import type { ReturnCache } from '../cache'; import { type ApplicationEmojiStructure, type GuildEmojiStructure, type GuildStructure, type UserStructure } from '../client'; import type { UsingClient } from '../commands'; import { type EmojiShorter, type MethodContext, type ObjectToLower, type When } from '../common'; import type { APIApplicationEmoji, APIEmoji, RESTPatchAPIApplicationEmojiJSONBody, RESTPatchAPIGuildEmojiJSONBody } from '../types'; import { DiscordBase } from './extra/DiscordBase'; export interface Emoji extends DiscordBase, ObjectToLower<Omit<APIEmoji, 'id' | 'user'>> { } export declare class Emoji<T extends boolean = false> extends DiscordBase { user: When<T, UserStructure>; constructor(client: UsingClient, data: APIEmoji); url(options?: BaseCDNUrlOptions): string; toString(): string; toJSON(): { id: string; name: string | null; animated: boolean; }; } export interface GuildEmoji extends Emoji { } export declare class GuildEmoji extends Emoji { readonly guildId: string; constructor(client: UsingClient, data: APIEmoji, guildId: string); guild(mode?: 'rest' | 'flow'): Promise<GuildStructure<'cached' | 'api'>>; guild(mode: 'cache'): ReturnCache<GuildStructure<'cached'> | undefined>; edit(body: RESTPatchAPIGuildEmojiJSONBody, reason?: string): Promise<GuildEmojiStructure>; delete(reason?: string): Promise<void>; fetch(force?: boolean): Promise<GuildEmojiStructure>; static methods({ client, guildId }: MethodContext<{ guildId: string; }>): { edit: (emojiId: string, body: RESTPatchAPIGuildEmojiJSONBody, reason?: string) => Promise<GuildEmojiStructure>; create: (body: Parameters<EmojiShorter["create"]>[1]) => Promise<GuildEmojiStructure>; fetch: (emojiId: string, force?: boolean) => Promise<GuildEmojiStructure>; list: (force?: boolean) => Promise<GuildEmojiStructure[]>; }; } export declare class ApplicationEmoji extends Emoji<true> { constructor(client: UsingClient, data: APIApplicationEmoji); fetch(): Promise<ApplicationEmojiStructure>; edit(body: RESTPatchAPIApplicationEmojiJSONBody): Promise<ApplicationEmojiStructure>; delete(): Promise<undefined>; }