Skip to content

Commit

Permalink
fix: interaction types (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
vaporoxx committed Mar 16, 2021
1 parent 003c3b8 commit 8dbd695
Showing 1 changed file with 12 additions and 18 deletions.
30 changes: 12 additions & 18 deletions typings/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,8 @@ declare module 'discord.js' {
public owner: User | Team | null;
public rpcOrigins: string[];
public createCommand(command: ApplicationCommandOptions): Promise<ApplicationCommand>;
public fetchCommands(): Promise<ApplicationCommand[]>;
public setCommands(commands: ApplicationCommandOptions[]): Promise<ApplicationCommand[]>;
public fetchCommands(): Promise<ApplicationCommand[]>;
public setCommands(commands: ApplicationCommandOptions[]): Promise<ApplicationCommand[]>;
}

export class ClientUser extends User {
Expand Down Expand Up @@ -344,19 +344,9 @@ declare module 'discord.js' {
public readonly createdTimestamp: number;
public readonly options: object;
public reply(
content: APIMessageContentResolvable | (MessageOptions & { split?: false }) | MessageAdditions,
): Promise<Message>;
public reply(options: MessageOptions & { split: true | SplitOptions }): Promise<Message[]>;
public reply(options: MessageOptions | APIMessage): Promise<Message | Message[]>;
public reply(
content: StringResolvable,
options: (MessageOptions & { split?: false }) | MessageAdditions,
): Promise<Message>;
public reply(
content: StringResolvable,
options: MessageOptions & { split: true | SplitOptions },
): Promise<Message[]>;
public reply(content: StringResolvable, options: MessageOptions): Promise<Message | Message[]>;
content: APIMessage | APIMessageContentResolvable | InteractionReplyOptions | MessageAdditions,
): Promise<void>;
public reply(content: StringResolvable, options: InteractionReplyOptions | MessageAdditions): Promise<void>;
}

type AllowedImageFormat = 'webp' | 'png' | 'jpg' | 'jpeg' | 'gif';
Expand Down Expand Up @@ -2393,7 +2383,7 @@ declare module 'discord.js' {
}

type ApplicationCommandOptionType =
| 'SUB_COMMAND'
| 'SUB_COMMAND'
| 'SUB_COMMAND_GROUP'
| 'STRING'
| 'INTEGER'
Expand Down Expand Up @@ -2496,7 +2486,7 @@ declare module 'discord.js' {
guildMemberSpeaking: [member: GuildMember | PartialGuildMember, speaking: Readonly<Speaking>];
guildMemberUpdate: [oldMember: GuildMember | PartialGuildMember, newMember: GuildMember];
guildUpdate: [oldGuild: Guild, newGuild: Guild];
interactionCreate: [interaction: Interaction];
interactionCreate: [interaction: Interaction];
inviteCreate: [invite: Invite];
inviteDelete: [invite: Invite];
message: [message: Message];
Expand Down Expand Up @@ -2926,6 +2916,10 @@ declare module 'discord.js' {
| 'DIRECT_MESSAGE_REACTIONS'
| 'DIRECT_MESSAGE_TYPING';

interface InteractionReplyOptions extends MessageOptions {
ephemeral?: boolean;
}

type InteractionResponseType = 'PONG' | 'CHANNEL_MESSAGE_WITH_SOURCE' | 'DEFERRED_CHANNEL_MESSAGE_WITH_SOURCE';

type InteractionType = 'PING' | 'APPLICATION_COMMAND';
Expand Down Expand Up @@ -3045,7 +3039,7 @@ declare module 'discord.js' {
}

type MessageFlagsString =
| 'CROSSPOSTED'
| 'CROSSPOSTED'
| 'IS_CROSSPOST'
| 'SUPPRESS_EMBEDS'
| 'SOURCE_MESSAGE_DELETED'
Expand Down

0 comments on commit 8dbd695

Please sign in to comment.