Skip to content

Commit

Permalink
types: add basic poll typings
Browse files Browse the repository at this point in the history
  • Loading branch information
TTtie committed Jul 11, 2024
1 parent 356f0ec commit 2b45a9f
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -767,6 +767,8 @@ declare namespace Dysnomia {
messageCreate: [message: Message<PossiblyUncachedTextableChannel>];
messageDelete: [message: PossiblyUncachedMessage];
messageDeleteBulk: [messages: PossiblyUncachedMessage[]];
messagePollVoteAdd: [message: PossiblyUncachedMessage, user: User | Uncached, answerID: string];
messagePollVoteRemove: [message: PossiblyUncachedMessage, user: User | Uncached, answerID: string];
messageReactionAdd: [message: PossiblyUncachedMessage, emoji: PartialEmoji, reactor: Member | Uncached];
messageReactionRemove: [message: PossiblyUncachedMessage, emoji: PartialEmoji, userID: string];
messageReactionRemoveAll: [message: PossiblyUncachedMessage];
Expand Down Expand Up @@ -1361,6 +1363,7 @@ declare namespace Dysnomia {
flags?: number;
messageReference?: MessageReferenceReply;
nonce?: T extends "hasNonce" ? (string | number) : never;
poll?: unknown; // TODO: document poll create object
stickerIDs?: string[];
tts?: boolean;
}
Expand Down Expand Up @@ -1464,6 +1467,11 @@ declare namespace Dysnomia {
limit?: number;
}

interface GetPollAnswerVotersOptions {
after?: string;
limit?: number;
}

interface InteractionButton extends ButtonBase {
custom_id: string;
style: ButtonStyleNormal;
Expand Down Expand Up @@ -2322,6 +2330,9 @@ declare namespace Dysnomia {
allVoice: 40136803878673n;
all: 1829587348619263n;
};
PollTypes: {
DEFAULT: 1;
};
PremiumTiers: {
NONE: 0;
TIER_1: 1;
Expand Down Expand Up @@ -2762,6 +2773,7 @@ declare namespace Dysnomia {
messageID: string,
options: MessageWebhookContent
): Promise<Message<GuildTextableChannel>>;
endPoll(channelID: string, messageID: string): Promise<Message>;
emit<K extends keyof ClientEvents>(event: K, ...args: ClientEvents[K]): boolean;

Check failure on line 2777 in index.d.ts

View workflow job for this annotation

GitHub Actions / Lint TypeScript files

Expected method emit to come before method endPoll
emit(event: string, ...args: any[]): boolean;

Check failure on line 2778 in index.d.ts

View workflow job for this annotation

GitHub Actions / Lint TypeScript files

Expected method emit to come before method endPoll
executeSlackWebhook(webhookID: string, token: string, options: Record<string, unknown> & { auth?: boolean; threadID?: string }): Promise<void>;
Expand Down Expand Up @@ -2812,6 +2824,7 @@ declare namespace Dysnomia {
getNitroStickerPacks(): Promise<{ sticker_packs: StickerPack[] }>;
getOAuthApplication(): Promise<OAuthApplicationInfo>;
getPins(channelID: string): Promise<Message[]>;
getPollAnswerVoters(channelID: string, messageID: string, answerID: string, options?: GetPollAnswerVotersOptions): Promise<User[]>;
getPruneCount(guildID: string, options?: GetPruneOptions): Promise<number>;
getRESTChannel(channelID: string): Promise<AnyChannel>;
getRESTGuild(guildID: string, withCounts?: boolean): Promise<Guild>;
Expand Down Expand Up @@ -3388,6 +3401,7 @@ declare namespace Dysnomia {
messageReference: MessageReference | null;
nonce?: string | number;
pinned: boolean;
poll?: unknown; // TODO: document poll object
position?: number;
reactions: { [s: string]: { count: number; me: boolean } };
referencedMessage?: Message | null;
Expand All @@ -3407,6 +3421,8 @@ declare namespace Dysnomia {
deleteWebhook(token: string): Promise<void>;
edit(content: MessageContent): Promise<Message<T>>;
editWebhook(token: string, options: MessageWebhookContent): Promise<Message<T>>;
endPoll(): Promise<Message<T>>;
getPollAnswerVoters(answerID: string, options?: GetPollAnswerVotersOptions): Promise<User[]>;
getReaction(reaction: string, options?: GetMessageReactionOptions): Promise<User[]>;
pin(): Promise<void>;
removeReaction(reaction: string, userID?: string): Promise<void>;
Expand Down

0 comments on commit 2b45a9f

Please sign in to comment.