import RESTManager from "./rest/RESTManager"; import TypedCollection from "./util/TypedCollection"; import PrivateChannel from "./structures/PrivateChannel"; import GroupChannel from "./structures/GroupChannel"; import User from "./structures/User"; import Guild from "./structures/Guild"; import type { AnyChannel, RawGroupChannel, RawPrivateChannel } from "./types/channels"; import type { RawGuild, RawUnavailableGuild } from "./types/guilds"; import type { RawUser } from "./types/users"; import type { ClientInstanceOptions, ClientOptions, Handlers } from "./types/client"; import TypedEmitter from "./util/TypedEmitter"; import type ClientApplication from "./structures/ClientApplication"; import ShardManager from "./gateway/ShardManager"; import type { BotActivity, SendStatuses } from "./types/gateway"; import UnavailableGuild from "./structures/UnavailableGuild"; import type ExtendedUser from "./structures/ExtendedUser"; import Util from "./util/Util"; import type { ClientEvents } from "./types/events"; import type { JoinVoiceChannelOptions } from "./types/voice"; import type { DiscordGatewayAdapterLibraryMethods, VoiceConnection } from "@discordjs/voice"; /** The primary class for interfacing with Discord. See {@link Events~ClientEvents | Client Events} for a list of events. */ export default class Client extends TypedEmitter { private _application?; private _user?; channelGuildMap: Record; gatewayURL: string; groupChannels: TypedCollection; guildShardMap: Record; guilds: TypedCollection; options: ClientInstanceOptions; privateChannels: TypedCollection; ready: boolean; rest: RESTManager; shards: ShardManager; startTime: number; threadGuildMap: Record; unavailableGuilds: TypedCollection; users: TypedCollection; util: Util; voiceAdapters: Map; folderData?: { commands: string; events: string; }; handlers?: Handlers | null; /** * @constructor * @param options The options to create the client with. */ constructor(options?: ClientOptions); /** The client's partial application. This will throw an error if not using a gateway connection or no shard is READY. */ get application(): ClientApplication; get uptime(): number; /** The client's user application. This will throw an error if not using a gateway connection or no shard is READY. */ get user(): ExtendedUser; /** The active voice connections of this client. */ get voiceConnections(): Map; /** Connect the client to Discord. */ connect(): Promise; /** * Disconnect all shards. * @param reconnect If shards should be reconnected. Defaults to {@link Types/Gateway~GatewayOptions#autoReconnect | GatewayOptions#autoReconnect} */ disconnect(reconnect?: boolean): void; /** * Edit the client's status across all shards. * @param status The status. * @param activities An array of activities. */ editStatus(status: SendStatuses, activities?: Array): Promise; /** * Get a channel from an ID. This will return undefined if the channel is not cached. * @param channelID The id of the channel. */ getChannel(channelID: string): T | undefined; /** * Get a voice connection. * @param guildID The ID of the guild the voice channel belongs to. */ getVoiceConnection(guildID: string): VoiceConnection | undefined; /** * Join a voice channel. * @param options The options to join the channel with. * */ joinVoiceChannel(options: JoinVoiceChannelOptions): VoiceConnection; /** * Leave a voice channel. * @param guildID The ID of the guild the voice channel belongs to. */ leaveVoiceChannel(guildID: string): void; }