export declare class Client extends AsyncEventEmitter<ManagerShardEventsMap>

Constructors

constructor(
{ rest, gateway }: ClientOptions
)

Constructs a new instance of the Client class

readonly
api : API

readonly
gateway : Gateway

readonly
rest : REST

requestGuildMembers() : Promise<{ members: APIGuildMember[]; nonce: string; notFound: unknown[]; presences: GatewayGuildMembersChunkPresence[]; }>

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

requestGuildMembersIterator() : AsyncGenerator<{ members: APIGuildMember[]; nonce: string; notFound: unknown[] | null; presences: GatewayGuildMembersChunkPresence[] | null; chunkIndex: number; chunkCount: number; }, void, unknown>

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

updatePresence() : Promise<void>

Updates the presence of the bot user

updateVoiceState() : Promise<void>

Updates the voice state of the bot user

See also: https://discord.com/developers/docs/topics/gateway-events#update-voice-state