class Client
extends
AsyncEventEmitter<ManagerShardEventsMap>export declare class Client extends AsyncEventEmitter<ManagerShardEventsMap>
Constructors
{ rest, gateway }: ClientOptions)
constructor({ rest, gateway }: ClientOptions
Constructs a new instance of the Client
class
requestGuildMembersoptions: GatewayRequestGuildMembersDatatimeout?: number) : Promise<{ members: APIGuildMember[]; nonce: string; notFound: unknown[]; presences: GatewayGuildMembersChunkPresence[]; }> (
options: GatewayRequestGuildMembersData
timeout?: number
Requests guild members from the gateway.
Examples:Requesting specific members from a guild
const { members } = await client.requestGuildMembers({ guild_id: '1234567890', user_ids: ['9876543210'] });
See also: https://discord.com/developers/docs/topics/gateway-events#request-guild-members
requestGuildMembersIteratoroptions: GatewayRequestGuildMembersDatatimeout?: number) : AsyncGenerator<{ members: APIGuildMember[]; nonce: string; notFound: unknown[] | null; presences: GatewayGuildMembersChunkPresence[] | null; chunkIndex: number; chunkCount: number; }, void, unknown> (
options: GatewayRequestGuildMembersData
timeout?: number
Requests guild members from the gateway and returns an async iterator that yields the data from each guild members chunk event.
Examples:Requesting all members from a guild
for await (const { members } of client.requestGuildMembersIterator({ guild_id: '1234567890', query: '', limit: 0 })) {
console.log(members);
}
See also: https://discord.com/developers/docs/topics/gateway-events#request-guild-members
updatePresenceshardId: numberoptions: GatewayPresenceUpdateData) : Promise<void> (
shardId: number
options: GatewayPresenceUpdateData
Updates the presence of the bot user
updateVoiceStateoptions: GatewayVoiceStateUpdateData) : Promise<void> (
options: GatewayVoiceStateUpdateData
Updates the voice state of the bot user
See also: https://discord.com/developers/docs/topics/gateway-events#update-voice-state