lilybird
Version:
A bun-first discord api wrapper written in TS
120 lines • 5.15 kB
TypeScript
import type { ApplicationCommandOption } from "./application-command-options.js";
import type { LilybirdAttachment, ResolvedDataStructure } from "./others.js";
import type { ApplicationCommand } from "./application-command.js";
import type { Application } from "./application.js";
import type { Channel } from "./channel.js";
import type { Message } from "./message.js";
import type { Guild } from "./guild.js";
import type { Embed } from "./embed.js";
import type { User } from "./user.js";
import type { Poll } from "./poll.js";
import type { InteractionCallbackType, EntitlementType, InteractionType, ComponentType, Locale, InteractionContextType } from "#enums";
export declare namespace Interaction {
type Structure = PingInteractionStructure | ApplicationCommandInteractionStructure | MessageComponentInteractionStructure | ModalSubmitInteractionStructure;
interface Base {
id: string;
application_id: string;
type: InteractionType;
data?: DataStructure;
token: string;
version: number;
app_permissions: string;
locale: Locale;
entitlements: Array<EntitlementStructure>;
authorizing_integration_owners: Application.IntegrationTypeMap;
context?: InteractionContextType;
}
interface GuildStructure extends Base {
guild_id: string;
channel: Partial<Channel.Structure>;
channel_id: string;
member: Guild.MemberStructure;
guild_locale: Locale;
}
interface DMStructure extends Base {
user: User.Structure;
}
type PingInteractionStructure = GuildPingStructure | DMPingStructure;
interface GuildPingStructure extends GuildStructure {
type: InteractionType.PING;
}
interface DMPingStructure extends DMStructure {
type: InteractionType.PING;
}
type ApplicationCommandInteractionStructure = GuildApplicationCommandInteractionStructure | DMApplicationCommandInteractionStructure;
interface GuildApplicationCommandInteractionStructure extends GuildStructure {
type: InteractionType.APPLICATION_COMMAND | InteractionType.APPLICATION_COMMAND_AUTOCOMPLETE;
data: ApplicationCommand.DataStructure;
}
interface DMApplicationCommandInteractionStructure extends DMStructure {
type: InteractionType.APPLICATION_COMMAND | InteractionType.APPLICATION_COMMAND_AUTOCOMPLETE;
data: ApplicationCommand.DataStructure;
}
type MessageComponentInteractionStructure = GuildMessageComponentInteractionStructure | DMMessageComponentInteractionStructure;
interface GuildMessageComponentInteractionStructure extends GuildStructure {
type: InteractionType.MESSAGE_COMPONENT;
data: MessageComponentDataStructure;
message: Message.Structure;
}
interface DMMessageComponentInteractionStructure extends DMStructure {
type: InteractionType.MESSAGE_COMPONENT;
data: MessageComponentDataStructure;
message: Message.Structure;
}
type ModalSubmitInteractionStructure = GuildModalSubmitInteractionStructure | DMModalSubmitInteractionStructure;
interface GuildModalSubmitInteractionStructure extends GuildStructure {
type: InteractionType.MODAL_SUBMIT;
data: ModalSubmitDataStructure;
}
interface DMModalSubmitInteractionStructure extends DMStructure {
type: InteractionType.MODAL_SUBMIT;
data: ModalSubmitDataStructure;
}
type DataStructure = ApplicationCommand.DataStructure | MessageComponentDataStructure | ModalSubmitDataStructure;
interface MessageComponentDataStructure {
custom_id: string;
component_type: ComponentType;
values?: Array<string>;
resolved?: ResolvedDataStructure;
}
interface ModalSubmitDataStructure {
custom_id: string;
components: Array<Message.Component.Structure>;
}
interface EntitlementStructure {
id: string;
sku_id: string;
user_id?: string;
guild_id?: string;
application_id: string;
type: EntitlementType;
consumed: boolean;
starts_at: string;
ends_at: string;
}
interface ResponseJSONParams {
type: InteractionCallbackType;
data?: CallbackData;
}
type CallbackData = MessageCallbackDataStructure | AutocompleteCallbackDataStructure | ModalCallbackDataStructure;
interface AutocompleteCallbackDataStructure {
choices: Array<ApplicationCommandOption.ChoiceStructure>;
}
interface MessageCallbackDataStructure {
tts?: boolean;
content?: string;
embeds?: Array<Embed.Structure>;
allowed_mentions?: Channel.AllowedMentionsStructure;
flags?: number;
components?: Array<Message.Component.Structure>;
attachments?: Array<Partial<Channel.AttachmentStructure>>;
files?: Array<LilybirdAttachment>;
poll?: Poll.CreateStructure;
}
interface ModalCallbackDataStructure {
custom_id: string;
title: string;
components: Array<Message.Component.Structure>;
}
}
//# sourceMappingURL=interaction.d.ts.map