hennus-api
Version:
Esta es una libreria para el bot Hennus
1,328 lines (1,271 loc) • 54.8 kB
TypeScript
import { ShardRange, WebSocketManager } from '@discordjs/ws';
import EventEmitter2 from 'eventemitter2';
import * as discord_api_types_v10 from 'discord-api-types/v10';
import { APIGuildChannelResolvable, APIGuildMember, APIRole, APIPartialEmoji, APIChannel, GatewayIntentBits, GuildMemberFlags, ChannelFlags, UserPremiumType, APIUser, ActivityType, Snowflake as Snowflake$1, APIEmoji, APIGuild, GatewayReadyDispatchData, APIButtonComponent, ButtonStyle, APISelectMenuComponent, APISelectMenuOption, ChannelType, APITextInputComponent, APIActionRowComponent, APIActionRowComponentTypes, APIEmbed, APIAllowedMentions, APIMessageReference, APIApplicationCommandOptionChoice, MessageFlags, APIGuildCategoryChannel, APIDMChannel, APIGroupDMChannel, APIGuildForumChannel, APITextChannel, APINewsChannel, APIThreadChannel, APIGuildVoiceChannel, APIGuildStageVoiceChannel, APIOverwrite, GatewayMessageCreateDispatchData, GatewayMessageUpdateDispatchData, GatewayPresenceUpdate, APIMessageComponentInteraction, ComponentType, APIMessageStringSelectInteractionData, APIMessageUserSelectInteractionData, APIMessageRoleSelectInteractionData, APIMessageMentionableSelectInteractionData, APIMessageChannelSelectInteractionData, APIModalSubmitInteraction, InteractionType, APIInteraction, APIChatInputApplicationCommandInteractionData, APIUserApplicationCommandInteractionData, APIMessageApplicationCommandInteractionData, ApplicationCommandType, APIApplicationCommandInteraction, APIApplicationCommandAutocompleteInteraction, APIApplicationCommandInteractionDataBasicOption, APIApplicationCommandInteractionDataSubcommandOption, ApplicationCommandOptionType, InteractionResponseType, APICommandAutocompleteInteractionResponseCallbackData, RESTPostAPIApplicationCommandsResult, APIApplicationCommand, GatewayVoiceState, APIMessage, RESTPostAPIApplicationCommandsJSONBody, GatewayDispatchPayload, GatewayGuildCreateDispatch, GatewaySendPayload } from 'discord-api-types/v10';
export { APIAttachment, APIEmbed, APIEmbedField, APIEmoji, APIMessageComponentEmoji, ActivityType, ApplicationCommandOptionType, ApplicationCommandType, ButtonStyle, ChannelFlags, ChannelType, ComponentType, GatewayIntentBits, GatewayVoiceState, MessageFlags, MessageType, PermissionFlagsBits, Routes, Snowflake, UserFlags } from 'discord-api-types/v10';
import * as _discordjs_collection from '@discordjs/collection';
import { Collection } from '@discordjs/collection';
export { Collection } from '@discordjs/collection';
import * as _discordjs_rest from '@discordjs/rest';
import { BaseImageURLOptions, ImageURLOptions, RawFile, REST, CDN, RequestData } from '@discordjs/rest';
import { Snowflake } from 'discord-api-types/globals';
import { Stream } from 'node:stream';
import { DistributiveOmit, StrictPartial, DistributivePick, AddUndefinedToPossiblyUndefinedPropertiesOfInterface } from 'discord-api-types/utils/internals';
declare enum Permissions {
CREATE_INSTANT_INVITE = 1,
KICK_MEMBERS = 2,
BAN_MEMBERS = 4,
ADMINISTRATOR = 8,
MANAGE_CHANNELS = 16,
MANAGE_GUILD = 32,
ADD_REACTIONS = 64,
VIEW_AUDIT_LOG = 128,
PRIORITY_SPEAKER = 256,
STREAM = 512,
VIEW_CHANNEL = 1024,
SEND_MESSAGES = 2048,
SEND_TTS_MESSAGES = 4096,
MANAGE_MESSAGES = 8192,
EMBED_LINKS = 16384,
ATTACH_FILES = 32768,
READ_MESSAGE_HISTORY = 65536,
MENTION_EVERYONE = 131072,
USE_EXTERNAL_EMOJIS = 262144,
VIEW_GUILD_INSIGHTS = 524288,
CONNECT = 1048576,
SPEAK = 2097152,
MUTE_MEMBERS = 4194304,
DEAFEN_MEMBERS = 8388608,
MOVE_MEMBERS = 16777216,
USE_VAD = 33554432,
CHANGE_NICKNAME = 67108864,
MANAGE_NICKNAMES = 134217728,
MANAGE_ROLES = 268435456,
MANAGE_WEBHOOKS = 536870912,
MANAGE_GUILD_EXPRESSIONS = 1073741824,
USE_APPLICATION_COMMANDS = 2147483648,
REQUEST_TO_SPEAK = 4294967296,
MANAGE_EVENTS = 8589934592,
MANAGE_THREADS = 17179869184,
CREATE_PUBLIC_THREADS = 34359738368,
CREATE_PRIVATE_THREADS = 68719476736,
USE_EXTERNAL_STICKERS = 137438953472,
SEND_MESSAGES_IN_THREADS = 274877906944,
USE_EMBEDDED_ACTIVITIES = 549755813888,
MODERATE_MEMBERS = 1099511627776,
VIEW_CREATOR_MONETIZATION_ANALYTICS = 2199023255552,
USE_SOUNDBOARD = 4398046511104,
USE_EXTERNAL_SOUNDS = 35184372088832,
SEND_VOICE_MESSAGES = 70368744177664
}
declare class cacheManager<T, V> {
readonly client: Client;
private _cache;
constructor(client: Client, iterable?: Iterable<readonly [T, V]> | null | undefined);
get rest(): HennusRest;
get cache(): Collection<T, V>;
resolve(data: T | V): V | undefined;
}
declare class MessagesManager extends cacheManager<Snowflake, Message> {
constructor(client: Client);
search: boolean;
fetch(id: string, options?: force): Promise<Message | undefined>;
fetchall(channelId: string): Promise<_discordjs_collection.Collection<string, Message>>;
fetchallR(channelId: string): Promise<Message[] | undefined>;
update(message: Message): this;
}
type force = {
force: true;
channelId: Snowflake;
} | {
force: false;
};
declare class ChannelsManager extends cacheManager<string, Channel> {
constructor(client: Client);
setall(map: Channel[]): Promise<boolean>;
update(channel: Channel): _discordjs_collection.Collection<string, Channel>;
search(guildId: Snowflake): _discordjs_collection.Collection<string, Channel>;
fetchall(guildId: Snowflake): Promise<_discordjs_collection.Collection<string, Channel>>;
createGuildChannel(guild_id: Snowflake, data: CreateGuildChannel): Promise<Channel | undefined>;
delete(id: Snowflake): Promise<Channel | undefined>;
edit(id: Snowflake, body: UpdateChannel): Promise<Channel | undefined>;
fetch(id: string, force?: boolean): Promise<Channel | undefined>;
}
type CreateGuildChannel = DistributiveOmit<GuildCreatePartialChannel, 'id'>;
type GuildCreatePartialChannel = StrictPartial<DistributivePick<APIGuildChannelResolvable, 'type' | 'topic' | 'nsfw' | 'bitrate' | 'user_limit' | 'rate_limit_per_user' | 'default_auto_archive_duration' | 'position' | 'rtc_region' | 'video_quality_mode' | 'flags' | 'default_reaction_emoji' | 'available_tags' | 'default_sort_order' | 'default_forum_layout' | 'default_thread_rate_limit_per_user'>> & {
name: string;
id?: number | string | undefined;
parent_id?: number | string | null | undefined;
permission_overwrites?: Overwrite[] | undefined;
};
declare class UsersManager extends cacheManager<string, User> {
constructor(client: Client);
update(user: User): void;
fetch(id: Snowflake, data?: {
force?: boolean;
}): Promise<User | undefined>;
}
declare class GuildsManager extends cacheManager<string, Guild> {
constructor(client: Client);
fetch(id: Snowflake, data?: {
force?: boolean;
}): Promise<Guild | undefined>;
add(guild: Guild): this;
}
declare class MembersManager extends cacheManager<string, GuildMember> {
private guildId;
constructor(client: Client, guildId: Snowflake);
private _maps;
fetch(id: Snowflake, options?: {
force?: false;
} | {
force?: true;
guildId?: Snowflake;
}): Promise<GuildMember | undefined>;
fetchall(): Promise<_discordjs_collection.Collection<string, GuildMember>>;
setall(members: APIGuildMember[], guild: Guild): Map<string, GuildMember>;
add(member: GuildMember): this;
}
declare class RolesManager extends cacheManager<Snowflake, GuildRoles> {
constructor(client: Client, Iterable?: APIRole[]);
private _maps;
fetch(id: string): GuildRoles | undefined;
fetchall(guildId: Snowflake): Promise<Collection<string, GuildRoles>>;
searchlist(ids: string[]): GuildRoles[];
setall(Iterable: APIRole[]): Collection<string, GuildRoles>;
get color(): GuildRoles | undefined;
get hoist(): GuildRoles | undefined;
}
declare class MemberRolesManager extends cacheManager<Snowflake, GuildRoles> {
constructor(client: Client, guildId: Snowflake, memberId: Snowflake);
add(id: Snowflake): Promise<GuildMember>;
remove(id: Snowflake): Promise<GuildMember>;
setall(roles: GuildRoles[]): this;
get color(): GuildRoles | undefined;
get hoist(): GuildRoles | undefined;
}
declare function resolvedColor(color: colorType): number;
type colorType = `#${string}` | number | StringColor | "Random" | Colors | [number, number, number];
type StringColor = keyof typeof Colors;
declare enum Colors {
Default = 0,
White = 16777215,
Aqua = 1752220,
Green = 5763719,
Blue = 3447003,
Yellow = 16705372,
Purple = 10181046,
LuminousVividPink = 15277667,
Fuchsia = 15418782,
Gold = 15844367,
Orange = 15105570,
Red = 15548997,
Grey = 9807270,
Navy = 3426654,
DarkAqua = 1146986,
DarkGreen = 2067276,
DarkBlue = 2123412,
DarkPurple = 7419530,
DarkVividPink = 11342935,
DarkGold = 12745742,
DarkOrange = 11027200,
DarkRed = 10038562,
DarkGrey = 9936031,
DarkerGrey = 8359053,
LightGrey = 12370112,
DarkNavy = 2899536,
Blurple = 5793266,
Greyple = 10070709,
DarkButNotBlack = 2895667,
NotQuiteBlack = 2303786,
Pink = 16761035,
Lavender = 15132410,
Coral = 16744272,
Teal = 32896,
Maroon = 8388608,
MintGreen = 10026904,
Olive = 8421376,
Salmon = 16416882,
Cyan = 65535,
Indigo = 4915330,
Peach = 16767673,
SkyBlue = 8900331,
LimeGreen = 3329330,
Magenta = 16711935,
Turquoise = 4251856,
DarkOliveGreen = 5597999,
LightCoral = 15761536,
SteelBlue = 4620980,
DarkMagenta = 9109643,
DarkSlateGray = 3100495,
Tomato = 16737095,
Brown = 9127187,
Crimson = 14423100,
DarkCyan = 35723,
DarkSalmon = 15308410,
DeepPink = 16716947,
ForestGreen = 2263842,
HotPink = 16738740,
Khaki = 15787660,
MediumBlue = 205,
MediumSpringGreen = 64154,
OliveDrab = 7048739,
Peru = 13468991,
RoyalBlue = 4286945,
SandyBrown = 16032864,
Sienna = 10506797,
Violet = 15631086,
DarkTurquoise = 52945,
Chocolate = 13789470,
FireBrick = 11674146,
LightSeaGreen = 2142890,
DarkKhaki = 12433259,
Orchid = 14315734,
PaleVioletRed = 14381203,
BananaYellow = 16766976,
AvocadoGreen = 8569665,
FunkyFuchsia = 16722099,
PunnyPurple = 10233776,
WackyWatermelon = 16729447,
GoofyGreen = 46848,
ChuckleChocolate = 5911842,
LoonyLemon = 16769333,
GiggleGrey = 11119017,
SillySalmon = 16747625,
NuttyNavy = 128,
KookyCoral = 16740193,
ZanyZucchini = 3778446,
QuirkyQuartz = 5326927,
BizarreBeige = 16119260,
HilariousHeliotrope = 14644223,
RidiculousRuby = 14684511,
DaffyDenim = 1668306,
BonkersBrown = 6636321,
ChucklesCyan = 65535,
ZestyZaffre = 5288,
ComicalCrimson = 14423100,
WittyWheat = 16113331,
DrollDandelion = 16701533
}
declare function decodeEmoji(text: string): APIPartialEmoji;
declare function resolvePartialEmoji(emoji: APIPartialEmoji | string): APIPartialEmoji | null;
declare function channelConvertidor(ch: APIChannel, client: Client): Channel | undefined;
declare class BaseData {
readonly client: Client;
constructor(client: Client);
get cdn(): _discordjs_rest.CDN;
get rest(): HennusRest;
imagen(_url?: string): Promise<{
data: any;
url: string;
type: "jpeg" | "gif" | "png" | "ico" | "webp";
content_type: any;
} | undefined>;
colorResolved: typeof resolvedColor;
}
type GatewayIntentsString = keyof typeof GatewayIntentBits;
declare class IntentsBitField extends BitField<GatewayIntentsString, GatewayIntentBits> {
Flags: typeof GatewayIntentBits;
bitfield: GatewayIntentBits;
resolve(bit?: BitFieldResolvable<GatewayIntentsString, number>): number;
has(data: GatewayIntentBits): boolean;
add(...data: GatewayIntentBits[]): BitField<"Guilds" | "GuildMembers" | "GuildModeration" | "GuildBans" | "GuildEmojisAndStickers" | "GuildIntegrations" | "GuildWebhooks" | "GuildInvites" | "GuildVoiceStates" | "GuildPresences" | "GuildMessages" | "GuildMessageReactions" | "GuildMessageTyping" | "DirectMessages" | "DirectMessageReactions" | "DirectMessageTyping" | "MessageContent" | "GuildScheduledEvents" | "AutoModerationConfiguration" | "AutoModerationExecution", GatewayIntentBits>;
}
declare class OverwriteBitField extends BitField<PermissionsString> {
Flags: typeof Permissions;
resolve(bit?: BitFieldResolvable<PermissionsString, number>): number;
has(data: Permissions): boolean;
add(...data: Permissions[]): BitField<"CREATE_INSTANT_INVITE" | "KICK_MEMBERS" | "BAN_MEMBERS" | "ADMINISTRATOR" | "MANAGE_CHANNELS" | "MANAGE_GUILD" | "ADD_REACTIONS" | "VIEW_AUDIT_LOG" | "PRIORITY_SPEAKER" | "STREAM" | "VIEW_CHANNEL" | "SEND_MESSAGES" | "SEND_TTS_MESSAGES" | "MANAGE_MESSAGES" | "EMBED_LINKS" | "ATTACH_FILES" | "READ_MESSAGE_HISTORY" | "MENTION_EVERYONE" | "USE_EXTERNAL_EMOJIS" | "VIEW_GUILD_INSIGHTS" | "CONNECT" | "SPEAK" | "MUTE_MEMBERS" | "DEAFEN_MEMBERS" | "MOVE_MEMBERS" | "USE_VAD" | "CHANGE_NICKNAME" | "MANAGE_NICKNAMES" | "MANAGE_ROLES" | "MANAGE_WEBHOOKS" | "MANAGE_GUILD_EXPRESSIONS" | "USE_APPLICATION_COMMANDS" | "REQUEST_TO_SPEAK" | "MANAGE_EVENTS" | "MANAGE_THREADS" | "CREATE_PUBLIC_THREADS" | "CREATE_PRIVATE_THREADS" | "USE_EXTERNAL_STICKERS" | "SEND_MESSAGES_IN_THREADS" | "USE_EMBEDDED_ACTIVITIES" | "MODERATE_MEMBERS" | "VIEW_CREATOR_MONETIZATION_ANALYTICS" | "USE_SOUNDBOARD" | "USE_EXTERNAL_SOUNDS" | "SEND_VOICE_MESSAGES", number>;
}
declare class PermissionsBitField extends BitField<PermissionsString, Permissions> {
Flags: typeof Permissions;
static All: bigint;
resolve(bit?: BitFieldResolvable<PermissionsString, number>): number;
has(data: Permissions): boolean;
add(...data: Permissions[]): BitField<"CREATE_INSTANT_INVITE" | "KICK_MEMBERS" | "BAN_MEMBERS" | "ADMINISTRATOR" | "MANAGE_CHANNELS" | "MANAGE_GUILD" | "ADD_REACTIONS" | "VIEW_AUDIT_LOG" | "PRIORITY_SPEAKER" | "STREAM" | "VIEW_CHANNEL" | "SEND_MESSAGES" | "SEND_TTS_MESSAGES" | "MANAGE_MESSAGES" | "EMBED_LINKS" | "ATTACH_FILES" | "READ_MESSAGE_HISTORY" | "MENTION_EVERYONE" | "USE_EXTERNAL_EMOJIS" | "VIEW_GUILD_INSIGHTS" | "CONNECT" | "SPEAK" | "MUTE_MEMBERS" | "DEAFEN_MEMBERS" | "MOVE_MEMBERS" | "USE_VAD" | "CHANGE_NICKNAME" | "MANAGE_NICKNAMES" | "MANAGE_ROLES" | "MANAGE_WEBHOOKS" | "MANAGE_GUILD_EXPRESSIONS" | "USE_APPLICATION_COMMANDS" | "REQUEST_TO_SPEAK" | "MANAGE_EVENTS" | "MANAGE_THREADS" | "CREATE_PUBLIC_THREADS" | "CREATE_PRIVATE_THREADS" | "USE_EXTERNAL_STICKERS" | "SEND_MESSAGES_IN_THREADS" | "USE_EMBEDDED_ACTIVITIES" | "MODERATE_MEMBERS" | "VIEW_CREATOR_MONETIZATION_ANALYTICS" | "USE_SOUNDBOARD" | "USE_EXTERNAL_SOUNDS" | "SEND_VOICE_MESSAGES", Permissions>;
}
declare class MemberFlags extends BitField<GuildMemberFlagsString, GuildMemberFlags> {
Flags: GuildMemberFlags;
bitfield: GuildMemberFlags;
resolve(bit?: GuildMemberFlags): GuildMemberFlags;
has(bit: GuildMemberFlags): boolean;
}
declare class channelFlags extends BitField<ChannelFlagsStrinmg, ChannelFlags> {
Flags: ChannelFlags;
bitfield: ChannelFlags;
resolve(bit?: ChannelFlags): ChannelFlags;
has(bit: ChannelFlags): boolean;
}
type ChannelFlagsStrinmg = keyof typeof ChannelFlags;
type GuildMemberFlagsString = keyof typeof GuildMemberFlags;
declare class BitField<T extends string, N extends number | bigint = number> {
Flags: EnumLike<unknown, number | bigint>;
DefaultBit: number | bigint;
bitfield: number | bigint;
constructor(bits?: BitFieldResolvable<T, N>);
any(bit: BitFieldResolvable<T, N>): boolean;
equals(bit: BitFieldResolvable<T, N>): boolean;
has(bit: BitFieldResolvable<T, N>): boolean;
missing(bits: BitFieldResolvable<T, N>, ...hasParams: any[]): T[];
freeze(): Readonly<BitField<T, N>>;
add(...bits: BitFieldResolvable<T, N>[]): BitField<T, N>;
private bitwiseOr;
remove(...bits: BitFieldResolvable<T, N>[]): BitField<T, N>;
private bitwiseAnd;
private bitwiseNot;
serialize(...hasParams: readonly unknown[]): Record<T, boolean>;
toArray(...hasParams: readonly unknown[]): T[];
toJSON(): string | number;
valueOf(): number | bigint;
[Symbol.iterator](...hasParams: readonly unknown[]): IterableIterator<T>;
resolve(bit?: BitFieldResolvable<string, number | bigint>): number | bigint;
}
type BitFieldResolvable<T extends string, N extends number | bigint> = RecursiveReadonlyArray<T | N | `${bigint}` | Readonly<BitField<T, N>>> | T | N | `${bigint}` | Readonly<BitField<T, N>>;
type RecursiveReadonlyArray<T> = ReadonlyArray<T | RecursiveReadonlyArray<T>>;
type EnumLike<E, V> = Record<keyof E, V>;
type PermissionsString = keyof typeof Permissions;
declare class GuildRoles extends BaseData {
private data;
id: string;
name: string;
color: number;
hoist: boolean;
position: number;
permissions: PermissionsBitField;
managed: boolean;
mentionable: boolean;
icon: string | undefined;
constructor(data: APIRole, client: Client);
iconURL(options?: BaseImageURLOptions): string | undefined;
toJson(): APIRole;
toString(): string;
get hexColor(): string;
}
declare class BaseUser extends BaseData {
private data;
id: string;
username: string;
discriminator: string;
premium: UserPremiumType;
bot: boolean;
globalName: string;
color: number;
avatar: string | undefined;
banner: string | undefined;
constructor(data: APIUser, client: Client);
get tag(): string;
avatarUrl(options?: ImageURLOptions): string | undefined;
bannerURL(options?: ImageURLOptions): string | undefined;
toJson(): APIUser;
toString(): string;
}
declare class ClientUser extends BaseUser {
constructor(data: APIUser, client: Client);
setActivity(status: Activity, shard?: number | number[]): void;
}
interface Activity {
activities: ActivityUpdate[];
status: PresenceStatus | "online" | "dnd" | "idle" | "invisible" | "offline";
}
interface ActivityUpdate {
name: string;
type: ActivityType;
url?: string | null;
}
declare enum PresenceStatus {
Online = "online",
Dnd = "dnd",
Idle = "idle",
Invisible = "invisible",
Offline = "offline"
}
declare class User extends BaseUser {
constructor(data: APIUser, client: Client);
}
declare class GuildEmojis extends BaseData {
name: string;
id?: Snowflake$1;
animated: boolean;
private _roles;
available: boolean;
managed: boolean;
require_colons: boolean;
user?: User;
guild: Guild;
constructor(emoji: APIEmoji, guild: Guild, client: Client);
get roles(): GuildRoles[];
toString(): string;
}
declare class GuildChannelsManager extends ChannelsManager {
constructor(client: Client, guild: Guild);
create(channel: CreateGuildChannel): Promise<Channel | undefined>;
}
declare class GuildMember extends BaseData {
private member;
guild: Guild;
user: User | undefined;
nick: string | undefined;
avatar: string | undefined;
private _roles;
joinedTimestamp: string | undefined;
premiumSinceTimestamp: string | undefined;
deaf: boolean;
mute: boolean;
flags: MemberFlags;
pending: boolean;
communicationDisabledUntilTimestamp: string | undefined;
constructor(member: APIGuildMember, guild: Guild, client: Client);
get roles(): MemberRolesManager;
avatarURL(options: ImageURLOptions): string | undefined;
get joinedAt(): "" | Date | undefined;
get premiumSince(): "" | Date | undefined;
get communicationDisabledUntil(): "" | Date | undefined;
get displayHexColor(): string;
toString(): string;
}
declare class Guild extends BaseData {
private data;
id: string;
name: string;
description: string | undefined;
icon: string | undefined;
banner: string | undefined;
memberCount: number;
constructor(data: APIGuild, client: Client);
get channels(): GuildChannelsManager;
get emojis(): _discordjs_collection.Collection<string, GuildEmojis>;
members: MembersManager;
roles: RolesManager;
iconURL(options?: ImageURLOptions): string | undefined;
bannerURL(options?: ImageURLOptions): string | undefined;
toJson(): APIGuild;
private _patch;
toString(): string;
}
declare class Ready {
private data;
readonly client: Client;
constructor(data: GatewayReadyDispatchData, client: Client);
get user(): User;
get aplication(): Pick<discord_api_types_v10.APIApplication, "id" | "flags">;
get guilds(): discord_api_types_v10.APIUnavailableGuild[];
get toJson(): GatewayReadyDispatchData;
}
declare class ButtonsBuilder {
type: number;
style: APIButtonComponent["style"];
label?: APIButtonComponent["label"];
emoji: APIButtonComponent["emoji"];
custom_id?: string;
url?: string;
constructor(options?: APIButtonComponent);
SetStyle(style: ButtonStyle | "Primary" | "Secondary" | "Success" | "Danger" | "Link"): this;
SetLabel(label: string): this;
SetEmoji(name: APIButtonComponent["emoji"] | string, id?: string, animated?: boolean): this;
SetCustomId(id: string): this;
SetURL(url: string): this;
}
declare class SelectMenuBuilder {
custom_id?: APISelectMenuComponent['custom_id'];
type: APISelectMenuComponent['type'];
options: APISelectMenuOption[];
channel_types?: ChannelType[];
placeholder?: APISelectMenuComponent["placeholder"];
min_values?: APISelectMenuComponent["min_values"];
max_values?: APISelectMenuComponent["max_values"];
disabled?: APISelectMenuComponent["disabled"];
constructor(options?: {
custom_id?: APISelectMenuComponent["custom_id"];
type?: selectMenuType;
channel_types?: ChannelType[];
placeholder?: APISelectMenuComponent["placeholder"];
min_values?: APISelectMenuComponent["min_values"];
max_values?: APISelectMenuComponent["max_values"];
disabled?: APISelectMenuComponent["disabled"];
options?: APISelectMenuOption[];
});
SetCustomId(custom: APISelectMenuComponent["custom_id"]): this;
SetType(type: selectMenuType): this;
SetPlaceHolder(text: string): this;
SetOptions(options: APISelectMenuOption[]): this;
AddOptions(options: APISelectMenuOption[]): this;
AddOption(option: APISelectMenuOption): this;
SetChannelTypes(channel_types: ChannelType[]): this;
SetMinValues(values: APISelectMenuComponent["min_values"]): this;
SetMaxValues(values: APISelectMenuComponent["max_values"]): this;
SetDisabled(disabled: APISelectMenuComponent["disabled"]): this;
private save;
}
type selectMenuType = APISelectMenuComponent["type"] | "Text" | "User" | "Role" | "Channels" | "Mentionable";
type TextInputStyle = "Paragraph" | "Short";
declare class TextInputBuilder {
type: 4;
custom_id?: APITextInputComponent["custom_id"];
style?: APITextInputComponent["style"];
label?: APITextInputComponent["label"];
min_length?: APITextInputComponent["min_length"];
max_length?: APITextInputComponent["max_length"];
required?: APITextInputComponent["required"];
value?: APITextInputComponent["value"];
placeholder?: APITextInputComponent["placeholder"];
constructor(option?: APITextInputComponent);
SetCustomID(custom: APITextInputComponent["custom_id"]): this;
SetStyle(style: APITextInputComponent["style"] | TextInputStyle): this;
SetLabel(label: APITextInputComponent["label"]): this;
SetMinLength(value: APITextInputComponent["min_length"]): this;
SetMaxLength(value: APITextInputComponent["max_length"]): this;
SetRequired(boolean: APITextInputComponent["required"]): this;
SetValue(value: APITextInputComponent["value"]): this;
SetPlaceholder(value: APITextInputComponent["placeholder"]): this;
}
type ComponentFormats = ButtonsBuilder | SelectMenuBuilder | TextInputBuilder;
declare class ActionRowBuilder {
type: APIActionRowComponent<APIActionRowComponentTypes>['type'];
components: ComponentFormats[];
constructor(options?: ComponentFormats[]);
AddComponents(components: ComponentFormats[]): this;
AddComponent(component: ComponentFormats): this;
private save;
}
declare class EmbedBuilder {
type: string;
title?: APIEmbed["title"];
description?: APIEmbed["description"];
url?: APIEmbed["url"];
timestamp?: APIEmbed["timestamp"];
color: APIEmbed["color"];
footer?: APIEmbed["footer"];
image?: APIEmbed["image"];
thumbnail?: APIEmbed["thumbnail"];
author?: APIEmbed["author"];
fields: APIEmbed["fields"];
constructor(options?: APIEmbed);
setTitle(value: string): this;
setDescription(value: string): this;
setURL(url: string): this;
setTimestamp(time?: Date): this;
setColor(color: colorType): this;
setFooter(option: APIEmbed["footer"]): this;
setImage(option: APIEmbed["image"] | string): this;
setThumbnail(option: APIEmbed["thumbnail"] | string): this;
setAuthor(option: APIEmbed["author"]): this;
setFields(fields: APIEmbed["fields"]): this;
addFields(fields: APIEmbed["fields"]): this;
addField(name: string, value: string, inline?: boolean): this;
private save;
}
declare class ModalBuilder {
components: Array<ActionRowBuilder>;
title?: string;
custom_id?: string;
constructor(options?: {
title: string;
custom_id: string;
components: Array<ActionRowBuilder>;
});
setTitle(title: string): this;
setCustomId(custom_id: string): this;
addTextInputComponents(components: Array<TextInputBuilder>): this;
setComponents(components: Array<ActionRowBuilder>, limitRows?: number): this;
addComponent(component: TextInputBuilder): this;
private findComponentById;
}
declare class AttachmentBuilder {
constructor(attachment: Buffer | string | Stream, data?: AttachmentData);
attachment: Buffer | string | Stream;
description: string | null;
name: string | null;
private isSpoiler;
setDescription(description: string): this;
setFile(attachment: Buffer | string | Stream, name?: string): this;
setName(name: string): this;
setSpoiler(spoiler?: boolean): this;
}
type AttachmentData = {
name?: string | undefined;
description?: string | undefined;
};
interface MessageOptions {
allowed_mentions?: APIAllowedMentions;
components?: ActionRowBuilder[];
content?: string;
embeds?: EmbedBuilder[];
attachments?: AttachmentBuilder[];
message_reference?: APIMessageReference;
tts?: boolean;
timeout?: number;
choice?: APIApplicationCommandOptionChoice[];
customId?: string;
title?: string;
flags?: MessageFlags;
ephemeral?: boolean;
}
type MessageChannelOptions = Omit<MessageOptions, "ephemeral" | "flags" | "title" | "choice" | "customId">;
type MessageInteractionOptions = Omit<MessageOptions, "tts" | "message_reference">;
type MessageCreateData = MessageChannelOptions | string;
declare class BaseChannel extends BaseData {
private _data;
id: string;
name: string;
flags: channelFlags["freeze"];
type: ChannelType;
constructor(_data: APIChannel, client: Client);
get createdTimestamp(): number;
get createdAt(): Date;
delete(): Promise<this>;
isChannelText(): this is BasedTextChannel;
isChannelDm(): this is BasedDmChannel;
isChannelVoice(): this is BasedVoiceChannel;
isChannelCategory(): this is BasedCategoryChannel;
isChannelForum(): this is BasedForumChannel;
isChannelthread(): this is BasedThreadChannel;
send(options: MessageCreateData): Promise<Message | undefined>;
toString(): string;
}
declare class BasedCategoryChannel extends BaseChannel {
private data;
guildId: string;
guild: Guild;
nsfw: boolean;
permission: {
id: string;
type: number;
deny: OverwriteBitField;
allow: OverwriteBitField;
}[];
position: number;
parent: string | undefined;
constructor(data: APIGuildCategoryChannel, client: Client);
toJson(): APIGuildCategoryChannel;
edit(data: Pick<UpdateTextAnnouncementChannel, "name" | "permission_overwrites" | "position">): Promise<BasedCategoryChannel>;
}
declare class BasedDmChannel extends BaseChannel {
private data;
private _cache_messages;
private dm?;
private dmGroup?;
lastMessage: string | undefined;
lastPin: string | undefined;
users: User[] | undefined;
constructor(data: APIDMChannel | APIGroupDMChannel, client: Client);
get messages(): MessagesManager;
iconURL(options?: BaseImageURLOptions): string | undefined;
toJson(): {
name: string | null;
application_id?: string | undefined;
icon?: string | null | undefined;
owner_id?: string | undefined;
last_message_id?: string | null | undefined;
managed?: boolean | undefined;
id: string;
type: ChannelType.GroupDM;
flags?: discord_api_types_v10.ChannelFlags | undefined;
last_pin_timestamp?: string | null | undefined;
recipients?: discord_api_types_v10.APIUser[] | undefined;
} | {
name: null;
id: string;
type: ChannelType.DM;
flags?: discord_api_types_v10.ChannelFlags | undefined;
last_message_id?: string | null | undefined;
last_pin_timestamp?: string | null | undefined;
recipients?: discord_api_types_v10.APIUser[] | undefined;
};
edit(data: UpdateDMGrupChannel): Promise<BasedDmChannel>;
}
declare class BasedForumChannel extends BaseChannel {
private data;
topic: string;
nsfw: boolean;
permission: {
id: string;
type: number;
deny: OverwriteBitField;
allow: OverwriteBitField;
}[];
position: number | undefined;
parent: string | undefined;
guildId: string;
guild: Guild;
lastPin: string | undefined;
lastMessage: string | undefined;
private _cache_messages;
constructor(data: APIGuildForumChannel, client: Client);
toJson(): APIGuildForumChannel;
get messages(): MessagesManager;
edit(data: UpdateForumChannel): Promise<BasedForumChannel>;
}
declare class BasedTextChannel extends BaseChannel {
private data;
topic: string;
nsfw: boolean;
permission: {
id: string;
type: number;
deny: OverwriteBitField;
allow: OverwriteBitField;
}[];
position: number | undefined;
parent: string | undefined;
guildId: string;
lastMessage: string | undefined;
guild: Guild;
private _cache_messages;
constructor(data: APITextChannel | APINewsChannel, client: Client);
get messages(): MessagesManager;
toJson(): APITextChannel | APINewsChannel;
edit(data: UpdateTextAnnouncementChannel): Promise<BasedTextChannel>;
}
declare class BasedThreadChannel extends BaseChannel {
private data;
nsfw: boolean;
permission: {
id: string;
type: number;
deny: OverwriteBitField;
allow: OverwriteBitField;
}[];
position: number | undefined;
parent: string | undefined;
lastPin: string;
lastMessage: string;
guildId: string;
private _cache_messages;
guild: Guild;
constructor(data: APIThreadChannel, client: Client);
get messages(): MessagesManager;
toJson(): APIThreadChannel;
edit(data: UpdateThreadChannel): Promise<BasedThreadChannel>;
}
declare class BasedVoiceChannel extends BaseChannel {
private data;
private _cache_messages;
guildId: string;
guild: Guild;
lastMessage: string;
bitrate: number;
nsfw: boolean;
permission: {
id: string;
type: number;
deny: OverwriteBitField;
allow: OverwriteBitField;
}[];
position: number | undefined;
parent: string | undefined;
constructor(data: APIGuildVoiceChannel | APIGuildStageVoiceChannel, client: Client);
get messages(): MessagesManager;
toJson(): APIGuildVoiceChannel | APIGuildStageVoiceChannel;
edit(data: UpdateVoiceStageChannel): Promise<BasedVoiceChannel>;
}
type Channel = BasedTextChannel | BasedDmChannel | BasedVoiceChannel | BasedCategoryChannel | BasedForumChannel | BasedThreadChannel;
type UpdateChannel = UpdateDMGrupChannel | UpdateForumChannel | UpdateTextAnnouncementChannel | UpdateThreadChannel | UpdateVoiceStageChannel;
type Overwrite = Omit<APIOverwrite, "allow" | "deny"> & {
deny?: Permissions;
allow?: Permissions;
};
interface UpdateTextAnnouncementChannel {
name?: string;
type?: ChannelType.GuildNews;
position?: number;
topic?: string;
nsfw?: boolean;
rate_limit_per_user?: number;
permission_overwrites?: Overwrite[];
parent_id?: string;
rtc_region?: string;
default_auto_archive_duration?: number;
}
interface UpdateVoiceStageChannel {
name?: string;
position?: number;
permission_overwrites?: Overwrite[];
bitrate?: number;
user_limit?: number;
parent_id?: string;
rtc_region?: string;
video_quality_mode?: number;
}
interface UpdateForumChannel {
name?: string;
position?: number;
permission_overwrites?: Overwrite[];
topic?: string;
nsfw?: boolean;
rate_limit_per_user?: number;
flags?: number;
available_tags?: Tag[];
default_reaction_emoji?: Pick<Tag, "emoji_id" | "emoji_name"> | null;
default_thread_rate_limit_per_user?: number;
default_sort_order?: number;
default_forum_layout?: number;
}
interface Tag {
id: string;
name: string;
moderated: boolean;
emoji_id?: string;
emoji_name?: string;
}
interface UpdateThreadChannel {
name?: string;
topic?: string;
archived?: boolean;
auto_archive_duration?: 60 | 1440 | 4320 | 10080;
locked?: boolean;
invitable?: boolean;
rate_limit_per_user?: number;
flags?: ChannelFlags.Pinned;
applied_tags?: string[];
}
interface UpdateDMGrupChannel {
name?: string;
icon?: string;
}
declare class Message {
private message;
private client;
guild: Guild;
guildId: string;
channel: Channel;
channelId: string;
constructor(message: GatewayMessageCreateDispatchData | GatewayMessageUpdateDispatchData, client: Client);
get editedTimestamp(): string;
get id(): string;
get timestamp(): string;
get tts(): boolean;
get pinned(): boolean;
get embeds(): EmbedBuilder[];
get type(): 0 | discord_api_types_v10.MessageType;
get author(): User;
get member(): GuildMember;
get content(): string | undefined;
get mention(): {
users: User[];
channels: discord_api_types_v10.APIChannelMention[];
roles: string[];
everyone: boolean;
};
get components(): discord_api_types_v10.APIActionRowComponent<discord_api_types_v10.APIMessageActionRowComponent>[];
get toJson(): GatewayMessageCreateDispatchData | GatewayMessageUpdateDispatchData;
delete(): Promise<unknown>;
edit(data: MessageChannelOptions): Promise<unknown>;
ping(): Promise<unknown>;
}
declare class Presence extends BaseData {
private data;
user: User;
activities: any[];
clientStatus: any;
status: string;
guildId: string;
guild: Guild;
constructor(data: GatewayPresenceUpdate, client: Client);
toJson(): GatewayPresenceUpdate;
}
declare class InteractionButton extends ComponentsInteractionBased {
private btnData;
constructor(data: APIMessageComponentInteraction, client: Client);
}
declare class ComponentsInteractionBased extends BasedInteraction {
customId: string;
componetType: ComponentType;
constructor(data: APIMessageComponentInteraction, client: Client);
isButton(): this is InteractionButton;
isSelect(): this is InteractionSelectAny;
}
declare class InteractionSelectAny extends ComponentsInteractionBased {
selectData: APIMessageStringSelectInteractionData | APIMessageUserSelectInteractionData | APIMessageRoleSelectInteractionData | APIMessageMentionableSelectInteractionData | APIMessageChannelSelectInteractionData;
constructor(data: APIMessageComponentInteraction, client: Client);
get values(): string[];
get resolved(): {
user: (id: Snowflake$1) => discord_api_types_v10.APIUser;
member: (id: Snowflake$1) => discord_api_types_v10.APIInteractionDataResolvedGuildMember;
channel: (id: Snowflake$1) => discord_api_types_v10.APIInteractionDataResolvedChannel;
role: (id: Snowflake$1) => discord_api_types_v10.APIRole;
mentionable: {
user: (id: string) => discord_api_types_v10.APIUser;
member: (id: string) => discord_api_types_v10.APIInteractionDataResolvedGuildMember;
role: (id: string) => discord_api_types_v10.APIRole;
};
};
private get mentionable();
private resolve;
}
type ComponentsInteraction = InteractionSelectAny | InteractionButton;
declare class InteractionModal extends BasedInteraction {
private modaldata;
customId: string;
constructor(data: APIModalSubmitInteraction, client: Client);
get components(): discord_api_types_v10.ModalSubmitComponent[];
}
declare class BasedInteraction extends BaseData {
id: string;
token: string;
aplicationId: string;
guildID: string;
guild: Guild;
channel: Channel;
message?: Message;
type: InteractionType;
member: GuildMember;
user: User;
constructor(data: APIInteraction, client: Client);
isCommand(): this is InteractionCommands;
isComponents(): this is (InteractionButton | InteractionSelectAny);
isModal(): this is InteractionModal;
reply(options: MessageInteractionOptions | string): Promise<any>;
respond(modal: ModalBuilder): Promise<any>;
}
declare class InteractionCommands extends BasedInteraction {
cmdData: APIChatInputApplicationCommandInteractionData | APIUserApplicationCommandInteractionData | APIMessageApplicationCommandInteractionData | APIChatInputApplicationCommandInteractionData;
commandName: string;
commandId: string;
commandType: ApplicationCommandType;
constructor(data: APIApplicationCommandInteraction | APIApplicationCommandAutocompleteInteraction, client: Client);
options: Options;
toString(): string;
}
declare class Options {
private data;
constructor(data: InteractionCommands);
get(name: string, required: boolean): APIApplicationCommandInteractionDataBasicOption | undefined;
getString<R extends boolean = false>(name: string, required?: R): OPString<R>;
getInteger<R extends boolean = false>(name: string, required?: R): OPInteger<R>;
getNumber<R extends boolean = false>(name: string, required?: R): OPNumber<R>;
getBoolean<R extends boolean = false>(name: string, required?: R): OPBoolean<R>;
getUser<R extends boolean = false>(name: string, required?: R): OPUser<R>;
getChannel<R extends boolean = false>(name: string, required?: R): OPChannel<R>;
getRole<R extends boolean = false>(name: string, required?: R): OPRole<R>;
getMentionable<R extends boolean = false>(name: string, required?: R): OPMentionable<R>;
getAttachment<R extends boolean = false>(name: string, required?: R): OPAttachment<R>;
get subCommand(): [name: string, options: APIApplicationCommandInteractionDataBasicOption[]];
get subCommandGroup(): [name: string, options: APIApplicationCommandInteractionDataSubcommandOption[]];
private find;
private datas;
}
type OPString<R extends boolean = false> = R extends true ? Extract<options, {
type: "string";
}>["return"] : Extract<options, {
type: "string";
}>["return"] | undefined;
type OPInteger<R extends boolean = false> = R extends true ? Extract<options, {
type: "integer";
}>["return"] : Extract<options, {
type: "integer";
}>["return"] | undefined;
type OPNumber<R extends boolean = false> = R extends true ? Extract<options, {
type: "number";
}>["return"] : Extract<options, {
type: "number";
}>["return"] | undefined;
type OPBoolean<R extends boolean = false> = R extends true ? Extract<options, {
type: "boolean";
}>["return"] : Extract<options, {
type: "boolean";
}>["return"] | undefined;
type OPUser<R extends boolean = false> = R extends true ? Extract<options, {
type: "user";
}>["return"] : Extract<options, {
type: "user";
}>["return"] | undefined;
type OPChannel<R extends boolean = false> = R extends true ? Extract<options, {
type: "channel";
}>["return"] : Extract<options, {
type: "channel";
}>["return"] | undefined;
type OPRole<R extends boolean = false> = R extends true ? Extract<options, {
type: "role";
}>["return"] : Extract<options, {
type: "role";
}>["return"] | undefined;
type OPMentionable<R extends boolean = false> = R extends true ? Extract<options, {
type: "mentionable";
}>["return"] : Extract<options, {
type: "mentionable";
}>["return"] | undefined;
type OPAttachment<R extends boolean = false> = R extends true ? Extract<options, {
type: "attachment";
}>["return"] : Extract<options, {
type: "attachment";
}>["return"] | undefined;
type options = {
type: "string";
return: {
name: string;
type: ApplicationCommandOptionType.String;
value: string;
};
} | {
type: "number";
return: {
name: string;
type: ApplicationCommandOptionType.Number;
value: number;
};
} | {
type: "integer";
return: {
name: string;
type: ApplicationCommandOptionType.Integer;
value: number;
};
} | {
type: "boolean";
return: {
name: string;
type: ApplicationCommandOptionType.Boolean;
value: boolean;
};
} | {
type: "user";
return: {
name: string;
type: ApplicationCommandOptionType.User;
id: Snowflake$1;
user?: User;
};
} | {
type: "channel";
return: {
name: string;
type: ApplicationCommandOptionType.Channel;
id: Snowflake$1;
channel?: Channel;
};
} | {
type: "role";
return: {
name: string;
type: ApplicationCommandOptionType.Role;
id: Snowflake$1;
role?: GuildRoles;
};
} | {
type: "mentionable";
return: {
name: string;
type: ApplicationCommandOptionType.Mentionable;
value: Snowflake$1;
};
} | {
type: "attachment";
return: {
name: string;
type: ApplicationCommandOptionType.Attachment;
value: string;
};
} | {
type: "subcommandGroup";
return: subcommandGroup["return"];
} | {
type: "subcommand";
return: subcommand["return"];
};
interface subcommand {
type: "subcommand";
return: [name: string, options: APIApplicationCommandInteractionDataBasicOption[]];
}
interface subcommandGroup {
type: "subcommandGroup";
return: [name: string, options: APIApplicationCommandInteractionDataSubcommandOption[]];
}
type interactionBase = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<Omit<APIApplicationCommand, 'id' | 'application_id' | 'description' | 'type' | 'version' | 'guild_id' | 'name_localized' | 'description_localized' | 'default_member_permissions'> & Partial<Pick<{
default_member_permissions?: Permissions | Permissions[];
}, "default_member_permissions">>>;
interface ChatInputApplicationCommands extends interactionBase {
type?: ApplicationCommandType.ChatInput | undefined;
description: string;
}
interface ContextMenuApplicationCommands extends interactionBase {
type: ApplicationCommandType.User | ApplicationCommandType.Message;
}
type ApplicationCommandData = ChatInputApplicationCommands | ContextMenuApplicationCommands;
type interactionResponse = {
type: InteractionResponseType.Pong;
} | {
type: InteractionResponseType.ChannelMessageWithSource;
data: MessageInteractionOptions;
} | {
type: InteractionResponseType.DeferredChannelMessageWithSource;
data?: Pick<MessageInteractionOptions, "flags">;
} | {
type: InteractionResponseType.DeferredMessageUpdate;
} | {
type: InteractionResponseType.UpdateMessage;
data?: MessageInteractionOptions;
} | {
type: InteractionResponseType.ApplicationCommandAutocompleteResult;
data: APICommandAutocompleteInteractionResponseCallbackData;
} | {
type: InteractionResponseType.Modal;
data: ModalBuilder;
};
type interactionResult = RESTPostAPIApplicationCommandsResult;
type Interaction = InteractionCommands | InteractionModal | ComponentsInteraction;
interface ListEvents {
ApplicationCommandPermissionsUpdate: [];
ChannelCreate: [channel: Channel];
ChannelDelete: [channel: Channel];
ChannelPinsUpdate: [];
ChannelUpdate: [channel: Channel];
GuildBanAdd: [];
GuildBanRemove: [];
GuildCreate: [guild: Guild];
GuildDelete: [guild: Guild];
GuildEmojisUpdate: [];
GuildIntegrationsUpdate: [];
GuildMemberAdd: [member: GuildMember];
GuildMemberRemove: [member: GuildMember];
GuildMembersChunk: [members: GuildMember[]];
GuildMemberUpdate: [NewMember: GuildMember, OldMember?: GuildMember];
GuildRoleCreate: [];
GuildRoleDelete: [];
GuildRoleUpdate: [];
GuildStickersUpdate: [];
GuildUpdate: [guild: Guild];
IntegrationCreate: [];
IntegrationDelete: [];
IntegrationUpdate: [];
InteractionCreate: [interaction: Interaction];
InviteCreate: [];
InviteDelete: [];
MessageCreate: [message: Message];
MessageDelete: [message: Message];
MessageDeleteBulk: [];
MessageReactionAdd: [];
MessageReactionRemove: [];
MessageReactionRemoveAll: [];
MessageReactionRemoveEmoji: [];
MessageUpdate: [New: Message, Old: Message | undefined];
PresenceUpdate: [presence: Presence];
StageInstanceCreate: [];
StageInstanceDelete: [];
StageInstanceUpdate: [];
Ready: [ready: Ready];
Resumed: [];
ThreadCreate: [];
ThreadDelete: [];
ThreadListSync: [];
ThreadMembersUpdate: [];
ThreadMemberUpdate: [];
ThreadUpdate: [];
TypingStart: [];
UserUpdate: [user: User];
VoiceServerUpdate: [];
VoiceStateUpdate: [voice: GatewayVoiceState];
WebhooksUpdate: [];
GuildScheduledEventCreate: [];
GuildScheduledEventUpdate: [];
GuildScheduledEventDelete: [];
GuildScheduledEventUserAdd: [];
GuildScheduledEventUserRemove: [];
AutoModerationRuleCreate: [];
AutoModerationRuleUpdate: [];
AutoModerationRuleDelete: [];
AutoModerationActionExecution: [];
GuildAuditLogEntryCreate: [];
}
type EventsHandler = {
[K in keyof ListEvents]: (...args: ListEvents[K]) => unknown;
};
interface getReturn {
user: APIUser;
userGuilds: Pick<APIGuild, "owner" | "name" | "id" | "icon" | "permissions" | "features">[];
guild: APIGuild;
guildMember: APIGuildMember;
guildMembers: APIGuildMember[];
guildChannels: APIChannel[];
guildRoles: APIRole[];
channel: APIChannel;
channelMessage: APIMessage;
channelMessages: APIMessage[];
}
interface getOptions {
user: [userId?: Snowflake];
userGuilds: [];
guild: [id: Snowflake];
guildMember: [guildId: Snowflake, memberId: Snowflake];
guildMembers: [guildId: Snowflake];
guildRoles: [guildId: string];
guildChannels: [guildId: Snowflake];
channel: [channelId: string];
channelMessage: [cahnnelId: Snowflake, messageId: Snowflake];
channelMessages: [cahnnelId: Snowflake];
}
interface getLink {
user: `/users/${string}`;
userGuilds: `/users/@me/guilds`;
channel: `/channels/${string}`;
guild: `/guilds/${string}`;
guildMember: `/guilds/${string}/members/${string}`;
guildMembers: `/guilds/${string}/members`;
guildRoles: `/guilds/${string}/roles`;
guildChannels: `/guilds/${string}/channel`;
channelMessage: `/channels/${string}/messages/${string}`;
channelMessages: `/channels/${string}/messages`;
}
declare function GetRoutes<T extends keyof getOptions>(type: T, ...args: getOptions[T]): getLink[T];
interface getNode {
user: {
return: User;
data: getOptions["user"];
};
userGuilds: {
return: Pick<APIGuild, "owner" | "name" | "id" | "icon" | "permissions" | "features">[];
data: getOptions["userGuilds"];
};
guildChannels: {
return: Channel[];
data: getOptions['guildChannels'];
};
guild: {
return: Guild;
data: getOptions['guild'];
};
guildMember: {
return: GuildMember;
data: getOptions['guildMember'];
};
guildMembers: {
return: GuildMember[];
data: getOptions['guildMembers'];
};
guildRoles: {
return: GuildRoles[];
data: getOptions['guildRoles'];
};
channel: {
return: Channel;
data: getOptions["channel"];
};
channelMessage: {
return: Message;
data: getOptions['channelMessage'];
};
channelMessages: {
return: Message[];
data: getOptions['channelMessages'];
};
}
interface postReturn {
channelMessages: APIMessage;
interactionCallback: unknown;
applicationCommands: interactionResult[];
}
interface postOptions {
channelMessages: [channelId: string];
interactionCallback: [interactionId: string, interactionToken: string];
applicationCommands: [applicationId: string];
}
interface postLink {
channelMessages: `/channels/${string}/messages`;
interactionCallback: `/interactions/${string}/${string}/callback`;
applicationCommands: `/applications/${string}/commands`;
}
declare function postRoutes<T extends keyof postOptions>(type: T, ...args: postOptions[T]): postLink[T];
interface postNode {
channelMessages: {
return: Message;
args: MessageChannelOptions | {
files: