///
import { ChannelTypes, type DiscordAllowedMentions, type DiscordGetGatewayBot, type DiscordMember, type DiscordMemberWithUser, type GatewayIntents, type GetMessagesOptions, type OverwriteTypes } from '@discordeno/types';
import EventEmitter from 'node:events';
import Collection from './Collection.js';
import type { IntentStrings } from './Constants.js';
import ShardManager from './gateway/ShardManager.js';
import RequestHandler from './RequestHandler.js';
import type CategoryChannel from './Structures/channels/Category.js';
import type Channel from './Structures/channels/Channel.js';
import type GuildChannel from './Structures/channels/Guild.js';
import type NewsChannel from './Structures/channels/News.js';
import PrivateChannel from './Structures/channels/Private.js';
import type StageChannel from './Structures/channels/Stage.js';
import type TextChannel from './Structures/channels/Text.js';
import type TextVoiceChannel from './Structures/channels/TextVoice.js';
import ThreadMember from './Structures/channels/threads/Member.js';
import type NewsThreadChannel from './Structures/channels/threads/NewsThread.js';
import type PrivateThreadChannel from './Structures/channels/threads/PrivateThread.js';
import type PublicThreadChannel from './Structures/channels/threads/PublicThread.js';
import type ThreadChannel from './Structures/channels/threads/Thread.js';
import type VoiceChannel from './Structures/channels/Voice.js';
import GuildAuditLogEntry from './Structures/guilds/AuditLogEntry.js';
import Guild from './Structures/guilds/Guild.js';
import GuildIntegration from './Structures/guilds/Integration.js';
import Member from './Structures/guilds/Member.js';
import GuildPreview from './Structures/guilds/Preview.js';
import Role from './Structures/guilds/Role.js';
import StageInstance from './Structures/guilds/StageInstance.js';
import GuildTemplate from './Structures/guilds/Template.js';
import type UnavailableGuild from './Structures/guilds/Unavailable.js';
import type { VoiceState } from './Structures/guilds/VoiceState.js';
import type AutocompleteInteraction from './Structures/interactions/Autocomplete.js';
import type CommandInteraction from './Structures/interactions/Command.js';
import type ComponentInteraction from './Structures/interactions/Component.js';
import type Interaction from './Structures/interactions/Interaction.js';
import type PingInteraction from './Structures/interactions/Ping.js';
import type UnknownInteraction from './Structures/interactions/Unknown.js';
import Invite from './Structures/Invite.js';
import Message from './Structures/Message.js';
import Permission from './Structures/Permission.js';
import type PermissionOverwrite from './Structures/PermissionOverwrite.js';
import ExtendedUser from './Structures/users/Extended.js';
import User from './Structures/users/User.js';
import type { ActivityPartial, AllowedMentions, AnyChannel, AnyGuildChannel, ApplicationCommand, ApplicationCommandPermissions, ApplicationCommandStructure, BotActivityType, ChannelFollow, ChannelPosition, ClientEvents, CreateChannelInviteOptions, CreateChannelOptions, CreateGuildOptions, CreateStickerOptions, CreateThreadOptions, CreateThreadWithoutMessageOptions, DiscoveryCategory, DiscoveryMetadata, DiscoveryOptions, DiscoverySubcategoryResponse, EditChannelOptions, EditChannelPositionOptions, EditStickerOptions, Emoji, EmojiOptions, FileContent, GetArchivedThreadsOptions, GetGuildAuditLogOptions, GetGuildBansOptions, GetMessageReactionOptions, GetPruneOptions, GetRESTGuildMembersOptions, GetRESTGuildsOptions, GuildApplicationCommandPermissions, GuildAuditLog, GuildBan, GuildOptions, GuildTemplateOptions, GuildVanity, IntegrationOptions, InteractionResponse, ListedChannelThreads, ListedGuildThreads, MemberOptions, MessageContent, MessageContentEdit, MessageWebhookContent, OAuthApplicationInfo, PruneMemberOptions, PurgeChannelOptions, RoleOptions, SelfStatus, StageInstanceOptions, Sticker, StickerPack, VoiceRegion, VoiceStateOptions, Webhook, WebhookOptions, WebhookPayload, WelcomeScreen, WelcomeScreenOptions, Widget, WidgetData } from './typings.js';
export declare class Client extends EventEmitter {
/** The cleaned up version of the provided configurations for the client. */
options: ParsedClientOptions;
/** The token used for this client. */
token: string;
/** The timestamp in milliseconds when this client was created. */
startTime: number;
CDN_URL: string;
CLIENT_URL: string;
guilds: Collection;
unavailableGuilds: Collection;
users: Collection;
_channelGuildMap: Collection;
_threadGuildMap: Collection;
_privateChannelMap: Collection;
privateChannels: Collection;
guildShardMap: Record;
/** Rest manager. Not recommended. */
requestHandler: RequestHandler;
/** Gateway manager. Not recommended */
shards: ShardManager;
/** The gateway url to connect to. */
gatewayURL: string;
/** Whether or not the client is fully ready. */
ready: boolean;
/** The reconnection delay from the last time it tried. */
lastReconnectDelay: number;
/** The amount of times it has already tried to reconnect. */
reconnectAttempts: number;
/** The client user */
user: ExtendedUser;
constructor(token: string, options: ClientOptions);
/** The amount of time in milliseconds that this client has been online for. */
get uptime(): number;
/** The api version to use. */
get apiVersion(): ApiVersions;
/** Change the api version when making requests. */
set apiVersion(version: ApiVersions);
/** The base url that will be used when making requests for discord api. */
get BASE_URL(): string;
/** The url to the REST proxy to send requests to. */
get proxyURL(): string;
/** The password/authorization to confirm that these request made to your rest proxy are indeed from you and not a hacker. */
get proxyRestAuthorization(): string;
/** The application id(NOT the bot id). The bot id and application id are the same for newer bots but older bots have different ids. */
get applicationId(): BigString;
/** Whether or not to seed voice connections. */
get seedVoiceConnections(): boolean;
get id(): BigString;
get channelGuildMap(): Record;
get threadGuildMap(): Record;
get privateChannelMap(): Record;
on(event: K, listener: (...args: ClientEvents[K]) => void): this;
/** Tells all shards to connect. This will call `getBotGateway()`, which is ratelimited. */
connect(): Promise;
/** Make a GET request to the discord api. */
get(url: string): Promise;
/** Make a POST request to the discord api. */
post(url: string, payload?: {
body?: Record;
reason?: string;
file?: FileContent | FileContent[];
}): Promise;
/** Make a PATCH request to the discord api. */
patch(url: string, payload?: {
body?: Record | null | string | any[];
reason?: string;
file?: FileContent | FileContent[];
}): Promise;
/** Make a PUT request to the discord api. */
put(url: string, payload?: {
body?: Record | any[];
reason?: string;
}): Promise;
/** Make a DELETE request to the discord api. */
delete(url: string, payload?: {
reason?: string;
}): Promise;
/** Add a guild discovery subcategory */
addGuildDiscoverySubcategory(guildID: BigString, categoryID: BigString, reason?: string): Promise;
/** Add a role to a guild member */
addGuildMemberRole(guildID: BigString, memberID: BigString, roleID: BigString, reason?: string): Promise;
/** Add a reaction to a message */
addMessageReaction(channelID: BigString, messageID: BigString, reaction: string): Promise;
/** Ban a user from a guild */
banGuildMember(guildID: BigString, userID: BigString, deleteMessageDays?: number, reason?: string): Promise;
/** Bulk create/edit global application commands */
bulkEditCommands(commands: ApplicationCommandStructure[]): Promise;
/** Bulk create/edit guild application commands */
bulkEditGuildCommands(guildID: BigString, commands: ApplicationCommand[]): Promise;
/** Create a channel in a guild */
createChannel(guildID: BigString, name: string): Promise;
createChannel(guildID: BigString, name: string, type: ChannelTypes.GuildText, options?: CreateChannelOptions): Promise;
createChannel(guildID: BigString, name: string, type: ChannelTypes.GuildVoice, options?: CreateChannelOptions): Promise;
createChannel(guildID: BigString, name: string, type: ChannelTypes.GuildCategory, options?: CreateChannelOptions): Promise;
createChannel(guildID: BigString, name: string, type: ChannelTypes.GuildAnnouncement, options?: CreateChannelOptions): Promise;
createChannel(guildID: BigString, name: string, type: ChannelTypes.GuildStageVoice, options?: CreateChannelOptions): Promise;
/** Create an invite for a channel */
createChannelInvite(channelID: BigString, options?: CreateChannelInviteOptions, reason?: string): Promise;
/** Create a channel webhook */
createChannelWebhook(channelID: BigString, options: {
name: string;
avatar?: string | null;
}, reason?: string): Promise;
/** Create a global application command */
createCommand(command: ApplicationCommandStructure): Promise;
/** Create a guild */
createGuild(name: string, options?: CreateGuildOptions): Promise;
/** Create a guild application command */
createGuildCommand(guildID: BigString, command: ApplicationCommandStructure): Promise;
/** Create a guild emoji object */
createGuildEmoji(guildID: BigString, options: EmojiOptions, reason?: string): Promise;
/** Create a guild based on a template. This can only be used with bots in less than 10 guilds */
createGuildFromTemplate(code: string, name: string, icon?: string): Promise;
/** Create a guild sticker */
createGuildSticker(guildID: BigString, options: CreateStickerOptions, reason?: string): Promise;
/** Create a template for a guild */
createGuildTemplate(guildID: BigString, name: string, description?: string): Promise;
/**
* Respond to the interaction with a message
* Note: Use webhooks if you have already responded with an interaction response.
*/
createInteractionResponse(interactionID: BigString, interactionToken: string, options: InteractionResponse, file?: FileContent | FileContent[]): Promise;
/**
* Create a message in a channel
* Note: If you want to DM someone, the user ID is **not** the DM channel ID. use Client.getDMChannel() to get the DM channel for a user
*/
createMessage(channelID: BigString, content: MessageContent, file?: FileContent | FileContent[]): Promise;
/** Create a guild role */
createRole(guildID: BigString, options: Role | RoleOptions, reason?: string): Promise;
/** Create a stage instance */
createStageInstance(channelID: BigString, options: StageInstanceOptions): Promise;
/** Create a thread with an existing message */
createThreadWithMessage(channelID: BigString, messageID: BigString, options: CreateThreadOptions): Promise;
/** Create a thread without an existing message */
createThreadWithoutMessage(channelID: BigString, options: CreateThreadWithoutMessageOptions): Promise;
/** Crosspost (publish) a message to subscribed channels */
crosspostMessage(channelID: BigString, messageID: BigString): Promise;
/** Delete a guild channel, or leave a private or group channel */
deleteChannel(channelID: BigString, reason?: string): Promise;
/** Delete a channel permission overwrite */
deleteChannelPermission(channelID: BigString, overwriteID: BigString, reason?: string): Promise;
/** Delete a global application command */
deleteCommand(commandID: BigString): Promise;
/** Delete a guild (bot user must be owner) */
deleteGuild(guildID: BigString): Promise;
/** Delete a guild application command */
deleteGuildCommand(guildID: BigString, commandID: BigString): Promise;
/** Delete a guild discovery subcategory */
deleteGuildDiscoverySubcategory(guildID: BigString, categoryID: BigString, reason?: string): Promise;
/** Delete a guild emoji object */
deleteGuildEmoji(guildID: BigString, emojiID: BigString, reason?: string): Promise;
/** Delete a guild integration */
deleteGuildIntegration(guildID: BigString, integrationID: BigString): Promise;
/** Delete a guild sticker */
deleteGuildSticker(guildID: BigString, stickerID: BigString, reason?: string): Promise;
/** Delete a guild template */
deleteGuildTemplate(guildID: BigString, code: string): Promise;
/** Delete an invite */
deleteInvite(inviteID: string, reason?: string): Promise;
/** Delete a message */
deleteMessage(channelID: BigString, messageID: BigString, reason?: string): Promise;
/** Bulk delete messages (bot accounts only) */
deleteMessages(channelID: BigString, messageIDs: BigString[], reason?: string): Promise;
/** Delete a guild role */
deleteRole(guildID: BigString, roleID: BigString, reason?: string): Promise;
/** Delete a stage instance */
deleteStageInstance(channelID: BigString): Promise;
/** Delete a webhook */
deleteWebhook(webhookID: BigString, token?: string, reason?: string): Promise;
/** Delete a webhook message */
deleteWebhookMessage(webhookID: BigString, token: string, messageID: BigString): Promise;
/** Edit a channel's properties */
editChannel(channelID: BigString, options: EditChannelOptions, reason?: string): Promise;
/** Create a channel permission overwrite */
editChannelPermission(channelID: BigString, overwriteID: BigString, allow: bigint | number, deny: bigint | number, type: OverwriteTypes, reason?: string): Promise;
/**
* Edit a guild channel's position. Note that channel position numbers are grouped by type (category, text, voice), then sorted in ascending order (lowest number is on top).
*/
editChannelPosition(channelID: BigString, position: number, options?: EditChannelPositionOptions): Promise;
/**
* Edit multiple guild channels' positions. Note that channel position numbers are grouped by type (category, text, voice), then sorted in ascending order (lowest number is on top).
*/
editChannelPositions(guildID: BigString, channelPositions: ChannelPosition[]): Promise;
/** Edit a global application command */
editCommand(commandID: BigString, command: ApplicationCommandStructure): Promise;
/** Edits command permissions for a specific command in a guild. */
editCommandPermissions(guildID: BigString, commandID: BigString, permissions: ApplicationCommandPermissions[]): Promise;
/** Edit a guild */
editGuild(guildID: BigString, options: GuildOptions, reason?: string): Promise;
/** Edit a guild application command */
editGuildCommand(guildID: BigString, commandID: BigString, command: ApplicationCommandStructure): Promise;
/** Edit a guild's discovery data */
editGuildDiscovery(guildID: BigString, options?: DiscoveryOptions): Promise;
/** Edit a guild emoji object */
editGuildEmoji(guildID: BigString, emojiID: BigString, options: {
name?: string;
roles?: string[];
}, reason?: string): Promise;
/** Edit a guild integration */
editGuildIntegration(guildID: BigString, integrationID: BigString, options: IntegrationOptions): Promise;
/** Edit a guild member */
editGuildMember(guildID: BigString, memberID: BigString, options: MemberOptions, reason?: string): Promise;
/** Edit a guild sticker */
editGuildSticker(guildID: BigString, stickerID: BigString, options?: EditStickerOptions, reason?: string): Promise;
/** Edit a guild template */
editGuildTemplate(guildID: BigString, code: string, options: GuildTemplateOptions): Promise;
/** Modify a guild's vanity code */
editGuildVanity(guildID: BigString, code: string | null): Promise;
/** Update a user's voice state - See [caveats](https://discord.com/developers/docs/resources/guild#modify-user-voice-state-caveats) */
editGuildVoiceState(guildID: BigString, options: VoiceStateOptions, userID?: BigString): Promise;
/** Edit a guild welcome screen */
editGuildWelcomeScreen(guildID: BigString, options: WelcomeScreenOptions): Promise;
/** Modify a guild's widget */
editGuildWidget(guildID: BigString, options: Widget): Promise;
/** Edit a message */
editMessage(channelID: BigString, messageID: BigString, content: MessageContentEdit): Promise;
/** Edit a guild role */
editRole(guildID: BigString, roleID: BigString, options: RoleOptions, reason?: string): Promise;
/** Edit a guild role's position. Note that role position numbers are highest on top and lowest at the bottom. */
editRolePosition(guildID: BigString, roleID: BigString, position: number): Promise;
/** Edit properties of the bot user */
editSelf(options: {
avatar?: string;
username?: string;
}): Promise;
/** Update a stage instance */
editStageInstance(channelID: BigString, options: StageInstanceOptions): Promise;
/**
* Updates the bot's status on all guilds the shard is in
*/
editStatus(status: SelfStatus, activities?: Array> | ActivityPartial): Promise;
/** Edit a webhook */
editWebhook(webhookID: BigString, options: WebhookOptions, token: string, reason?: string): Promise;
/** Edit a webhook message */
editWebhookMessage(webhookID: BigString, token: string, messageID: BigString, options: MessageWebhookContent): Promise;
/** Execute a slack-style webhook */
executeSlackWebhook(webhookID: BigString, token: string, options: Record & {
auth?: boolean;
threadID?: string;
}): Promise;
executeSlackWebhook(webhookID: BigString, token: string, options: Record & {
auth?: boolean;
threadID?: string;
wait: true;
}): Promise;
/** Execute a webhook */
executeWebhook(webhookID: BigString, token: string, options: WebhookPayload): Promise;
executeWebhook(webhookID: BigString, token: string, options: WebhookPayload & {
wait: true;
}): Promise;
/** Follow a NewsChannel in another channel. This creates a webhook in the target channel */
followChannel(channelID: BigString, webhookChannelID: BigString): Promise;
/** Get all active threads in a guild */
getActiveGuildThreads(guildID: BigString): Promise;
/** Get all archived threads in a channel */
getArchivedThreads(channelID: BigString, type: 'private', options?: GetArchivedThreadsOptions): Promise>;
getArchivedThreads(channelID: BigString, type: 'public', options?: GetArchivedThreadsOptions): Promise>;
/** Get general and bot-specific info on connecting to the Discord gateway (e.g. connection ratelimit) */
getBotGateway(): Promise;
/** Get a Channel object from a channel ID */
getChannel(channelID: BigString): AnyChannel | undefined;
/** Get all invites in a channel */
getChannelInvites(channelID: BigString): Promise;
/** Get all the webhooks in a channel */
getChannelWebhooks(channelID: BigString): Promise;
/** Get a global application command */
getCommand(commandID: BigString): Promise;
/** Get the a guild's application command permissions */
getCommandPermissions(guildID: BigString, commandID: BigString): Promise;
/** Get the global application commands */
getCommands(): Promise;
/** Get a list of discovery categories */
getDiscoveryCategories(): Promise;
/** Get a DM channel with a user, or create one if it does not exist */
getDMChannel(userID: BigString): Promise;
/** Get a guild from the guild's emoji ID */
getEmojiGuild(emojiID: BigString): Promise;
/** Get info on connecting to the Discord gateway */
getGateway(): Promise<{
url: string;
}>;
/** Get the audit log for a guild */
getGuildAuditLog(guildID: BigString, options?: GetGuildAuditLogOptions): Promise;
/** Get a ban from the ban list of guild */
getGuildBan(guildID: BigString, userID: BigString): Promise;
/** Get the ban list of a guild */
getGuildBans(guildID: BigString, options?: GetGuildBansOptions): Promise;
/** Get a guild application command */
getGuildCommand(guildID: BigString, commandID: BigString): Promise;
/** Get the all of a guild's application command permissions */
getGuildCommandPermissions(guildID: BigString): Promise;
/** Get a guild's application commands */
getGuildCommands(guildID: BigString): Promise;
/** Get a guild's discovery object */
getGuildDiscovery(guildID: BigString): Promise;
/** Get a list of integrations for a guild */
getGuildIntegrations(guildID: BigString): Promise;
/** Get all invites in a guild */
getGuildInvites(guildID: BigString): Promise;
/** Get a guild preview for a guild. Only available for community guilds. */
getGuildPreview(guildID: BigString): Promise;
/** Get a guild template */
getGuildTemplate(code: string): Promise;
/** Get a guild's templates */
getGuildTemplates(guildID: BigString): Promise;
/** Returns the vanity url of the guild */
getGuildVanity(guildID: BigString): Promise;
/** Get all the webhooks in a guild */
getGuildWebhooks(guildID: BigString): Promise;
/** Get the welcome screen of a Community guild, shown to new members */
getGuildWelcomeScreen(guildID: BigString): Promise;
/** Get a guild's widget object */
getGuildWidget(guildID: BigString): Promise;
/** Get a guild's widget settings object. Requires MANAGE_GUILD permission */
getGuildWidgetSettings(guildID: BigString): Promise;
/** Get info on an invite */
getInvite(inviteID: string, withCounts?: boolean): Promise;
/** Get joined private archived threads in a channel */
getJoinedPrivateArchivedThreads(channelID: BigString, options?: GetArchivedThreadsOptions): Promise>;
/** Get a previous message in a channel */
getMessage(channelID: BigString, messageID: BigString): Promise;
/** Get a list of users who reacted with a specific reaction */
getMessageReaction(channelID: BigString, messageID: BigString, reaction: string, options?: GetMessageReactionOptions): Promise;
/** Get previous messages in a channel */
getMessages(channelID: BigString, options?: GetMessagesOptions): Promise;
/** Get the list of sticker packs available to Nitro subscribers */
getNitroStickerPacks(): Promise<{
sticker_packs: StickerPack[];
}>;
/** Get data on an OAuth2 application */
getOAuthApplication(appID: BigString): Promise;
/** Get all the pins in a channel */
getPins(channelID: BigString): Promise;
/** Get the prune count for a guild */
getPruneCount(guildID: BigString, options?: GetPruneOptions): Promise;
/** Get a channel's data via the REST API. */
getRESTChannel(channelID: BigString): Promise;
/** Get a guild's data via the REST API. */
getRESTGuild(guildID: BigString, withCounts?: boolean): Promise;
/** Get a guild's channels via the REST API. */
getRESTGuildChannels(guildID: BigString): Promise;
/** Get a guild emoji via the REST API. */
getRESTGuildEmoji(guildID: BigString, emojiID: BigString): Promise;
/** Get a guild's emojis via the REST API. */
getRESTGuildEmojis(guildID: BigString): Promise;
/** Get a guild's members via the REST API. */
getRESTGuildMember(guildID: BigString, memberID: BigString): Promise;
/** Get a guild's members via the REST API. */
getRESTGuildMembers(guildID: BigString, options?: GetRESTGuildMembersOptions): Promise;
/** Get a guild's roles via the REST API. */
getRESTGuildRoles(guildID: BigString): Promise;
/** Get a list of the user's guilds via the REST API. */
getRESTGuilds(options?: GetRESTGuildsOptions): Promise;
/** Get a guild sticker via the REST API. */
getRESTGuildSticker(guildID: BigString, stickerID: BigString): Promise;
/** Get a guild's stickers via the REST API. */
getRESTGuildStickers(guildID: BigString): Promise;
/** Get a sticker via the REST API. */
getRESTSticker(stickerID: BigString): Promise;
/** Get a user's data via the REST API. */
getRESTUser(userID: BigString): Promise;
/** Get properties of the bot user */
getSelf(): Promise;
/** Get the stage instance associated with a stage channel */
getStageInstance(channelID: BigString): Promise;
/** Get a list of members that are part of a thread channel */
getThreadMembers(channelID: BigString): Promise;
/** Get a list of general/guild-specific voice regions */
getVoiceRegions(guildID: BigString): Promise;
/** Get a webhook */
getWebhook(webhookID: BigString, token: string): Promise;
/** Get a webhook message */
getWebhookMessage(webhookID: BigString, token: string, messageID: BigString): Promise;
/** Join a thread */
joinThread(channelID: BigString, userID?: BigString): Promise;
/** Kick a user from a guild */
kickGuildMember(guildID: BigString, userID: BigString, reason?: string): Promise;
/** Leave a guild */
leaveGuild(guildID: BigString): Promise;
/** Leave a thread */
leaveThread(channelID: BigString, userID?: BigString): Promise;
/** Pin a message */
pinMessage(channelID: BigString, messageID: BigString): Promise;
/** Begin pruning a guild */
pruneMembers(guildID: BigString, options?: PruneMemberOptions): Promise;
/** Purge previous messages in a channel with an optional filter (bot accounts only) */
purgeChannel(channelID: BigString, options: PurgeChannelOptions): Promise;
/** Remove a role from a guild member */
removeGuildMemberRole(guildID: BigString, memberID: BigString, roleID: BigString, reason?: string): Promise;
/** Remove a reaction from a message */
removeMessageReaction(channelID: BigString, messageID: BigString, reaction: string, userID?: BigString): Promise;
/** Remove all reactions from a message for a single emoji. */
removeMessageReactionEmoji(channelID: BigString, messageID: BigString, reaction: string): Promise;
/** Remove all reactions from a message */
removeMessageReactions(channelID: BigString, messageID: BigString): Promise;
/** Search for guild members by partial nickname/username */
searchGuildMembers(guildID: BigString, query: string, limit?: number): Promise;
/** Send typing status in a channel */
sendChannelTyping(channelID: BigString): Promise;
/** Force a guild integration to sync */
syncGuildIntegration(guildID: BigString, integrationID: BigString): Promise;
/** Force a guild template to sync */
syncGuildTemplate(guildID: BigString, code: string): Promise;
/** Unban a user from a guild */
unbanGuildMember(guildID: BigString, userID: BigString, reason?: string): Promise;
/** Unpin a message */
unpinMessage(channelID: BigString, messageID: BigString): Promise;
/** Validate discovery search term */
validateDiscoverySearchTerm(term: string): Promise<{
valid: boolean;
}>;
/** Converts the easy to type allowed mentions to the format discord requires. */
_formatAllowedMentions(allowed?: AllowedMentions): DiscordAllowedMentions;
_formatImage(url: string, format?: ImageFormat, size?: ImageSize): string;
/** Converts a snowflake(discord id) into a timestamp. */
snowflakeToTimestamp(snowflake: BigString): number;
/** Get the bot id from the bot token. WARNING: Discord staff has mentioned this may not be stable forever. Use at your own risk. However, note for over 5 years this has never broken. */
getBotIdFromToken(token: string): string;
/** Convert a icon hash into a bigint. */
iconHashToBigInt(hash: string): bigint;
/** Convert a icon bigint back into a hash. */
iconBigintToHash(icon: bigint): string;
/** Splits a large array into chunks of smaller arrays */
chunkArray(array: T[], size?: number): T[][];
toString(): string;
toJSON(props?: string[]): Record;
/** TS save way to check if a property exists in an object */
hasProperty(obj: T, prop: Y): obj is T & Record;
/** A typeguard that tells whether a member has the user property or not. */
isDiscordMemberWithUser(member: DiscordMember | DiscordMemberWithUser): member is DiscordMemberWithUser;
/** Removes properties from a Structure you don't want. For example, if your bot does not need Channel.topic you can remove it. */
removeProperties(obj: T, props: string[]): this;
}
export default Client;
export interface ClientOptions {
/**
* @deprecated this property does absolutely nothing. Please delete from ur code. Thanks.
* Keeping this only to preserve 1:1 api with eris.
*/
restMode?: boolean;
/** The default allowed mentions you would like to use. */
allowedMentions?: AllowedMentions;
/** The default image format you would like to use. */
defaultImageFormat?: ImageFormat;
/** The default image size you would like to use. */
defaultImageSize?: ImageSize;
/** The message limit you would like to set. */
messageLimit?: number;
/** The api version you would like to use. */
apiVersion?: ApiVersions;
/** The url to the REST proxy to send requests to. This url should nly include the initial domain:port portion until api/v.... */
proxyURL?: string;
/** The password/authorization to confirm that these request made to your rest proxy are indeed from you and not a hacker. */
proxyRestAuthorization?: string;
/** The application id(NOT the bot id). The bot id and application id are the same for newer bots but older bots have different ids. */
applicationId?: BigString;
/** Whether or not to seed voice connections. */
seedVoiceConnections?: boolean;
/** The concurrency to use when starting the bot. */
shardConcurrency?: 'auto' | number;
/** How many shards to use max. */
maxShards?: 'auto' | number;
/** Whether or not to enable websocket compression. NOT REcOMMENDED. */
compress?: boolean;
/** The first shard id to use. */
firstShardID?: number;
/** The last shard id to use. */
lastShardID?: number;
/** How many times to attempt resuming. */
maxResumeAttempts?: number;
/** The intents to use when connection to gateway. */
intents?: GatewayIntents | number | Array;
/** Whether or not to automatically reconnect to gateway. */
autoreconnect?: boolean;
/**
* How long in milliseconds to wait for a GUILD_CREATE before "ready" is fired. Increase this value if you notice missing guilds
* @default 2000
*/
guildCreateTimeout?: number;
/** Handler to determine how many milliseconds to wait before reconnecting. */
reconnectDelay?: (lastDelay: number, attempts: number) => Promise | number;
}
export interface ParsedClientOptions {
/** The discord api version to use. */
apiVersion: ApiVersions;
/** Allowed mentions */
allowedMentions: DiscordAllowedMentions;
/** The image format to use by default. */
defaultImageFormat: ImageFormat;
/** The image size to use by default. */
defaultImageSize: ImageSize;
/** The url to the REST proxy to send requests to. This url should nly include the initial domain:port portion until api/v.... */
proxyURL?: string;
/** The password/authorization to confirm that these request made to your rest proxy are indeed from you and not a hacker. */
proxyRestAuthorization?: string;
/** The application id(NOT the bot id). The bot id and application id are the same for newer bots but older bots have different ids. */
applicationId: BigString;
/** The message limit you would like to set. */
messageLimit?: number;
/** Whether or not to seed voice connections */
seedVoiceConnections: boolean;
/** The max concurrency for the bot */
shardConcurrency: 'auto' | number;
/** How many shards to use as max */
maxShards: 'auto' | number;
/** Whether or not to enable websocket compression. NOT REcOMMENDED. */
compress: boolean;
/** The first shard id to use. */
firstShardID: number;
/** The last shard id to use. */
lastShardID?: number;
/** How many times to attempt resuming. */
maxResumeAttempts: number;
/** The intents to use when connection to gateway. */
intents: GatewayIntents;
/** Whether or not to automatically reconnect to gateway. */
autoreconnect: boolean;
/** How long in milliseconds to wait for a GUILD_CREATE before "ready" is fired. Increase this value if you notice missing guilds */
guildCreateTimeout: number;
/** Handler to determine how many milliseconds to wait before reconnecting. */
reconnectDelay: (lastDelay: number, attempts: number) => Promise | number;
}
/** A union type of string or bigint to help make it easier for users to switch between one another. */
export type BigString = bigint | string;
/** The API versions that are supported. */
export type ApiVersions = 10;
/** The sizes for images that are supported. */
export type ImageSize = 16 | 32 | 64 | 128 | 256 | 512 | 1024 | 2048 | 4096;
/** The formats for images that are supported. */
export type ImageFormat = 'jpg' | 'jpeg' | 'png' | 'webp' | 'gif';
/** The methods that are acceptable for REST. */
export type RequestMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
export interface RequestData {
/** The method which should be used to send this request. */
method: RequestMethod;
/** The url to send this request to. */
url: string;
/** The headers you can send which will override internal headers or add others ones. */
headers?: Record;
/** The reason to add to the audit logs for this request. */
reason?: string;
/** The payload this request should send. */
body?: Record | string | null | any[];
/** The file contents that should be sent in this request. */
file?: FileContent | FileContent[];
}
//# sourceMappingURL=Client.d.ts.map