MemberShorter

Signature

export declare class MemberShorter extends BaseShorter

Methods

resolve(guildId: string, resolve: GuildMemberResolvable): Promise<GuildMemberStructure | undefined>;

Resolves a member in the guild based on the provided GuildMemberResolvable.

Parameters
guildId
The ID of the guild.
resolve
The GuildMemberResolvable to resolve.
Returns

A Promise that resolves to the resolved member.

unban(guildId: string, memberId: string, reason?: string): Promise<undefined>;

Unbans a member from the guild.

Parameters
guildId
The ID of the guild.
memberId
The ID of the member to unban.
reason
The reason for unbanning the member.
ban(guildId: string, memberId: string, options?: BanOptions): Promise<void>;

Bans a member from the guild.

Parameters
guildId
The ID of the guild.
memberId
The ID of the member to ban.
options
The options for banning the member.
kick(guildId: string, memberId: string, reason?: string): Promise<void>;

Kicks a member from the guild.

Parameters
guildId
The ID of the guild.
memberId
The ID of the member to kick.
reason
The reason for kicking the member.
add(guildId: string, memberId: string, body: RESTPutAPIGuildMemberJSONBody): Promise<GuildMemberStructure | undefined>;

Adds a member to the guild.

Parameters
guildId
The ID of the guild.
memberId
The ID of the member to add.
body
The request body for adding the member.
Returns

A Promise that resolves to the added member.

fetch(guildId: string, memberId: string, force?: boolean): Promise<GuildMemberStructure>;

Fetches a member from the guild.

Parameters
guildId
The ID of the guild.
memberId
The ID of the member to fetch.
force
Whether to force fetching the member from the API even if it exists in the cache.
Returns

A Promise that resolves to the fetched member.

list(guildId: string, query?: RESTGetAPIGuildMembersQuery, force?: boolean): Promise<GuildMemberStructure[]>;

Lists members in the guild based on the provided query.

Parameters
guildId
The ID of the guild.
query
The query parameters for listing members.
force
Whether to force listing members from the API even if they exist in the cache.
Returns

A Promise that resolves to an array of listed members.

addRole(guildId: string, memberId: string, id: string): Promise<undefined>;

Adds a role to a guild member.

Parameters
guildId
The ID of the guild.
memberId
The ID of the member to add the role to.
id
The ID of the role to add.
removeRole(guildId: string, memberId: string, id: string): Promise<undefined>;

Removes a role from a guild member.

Parameters
guildId
The ID of the guild.
memberId
The ID of the member to remove the role from.
id
The ID of the role to remove.
timeout(guildId: string, memberId: string, time: number | null, reason?: string): Promise<GuildMemberStructure>;

Timeouts a member from the guild.

Parameters
guildId
The ID of the guild.
memberId
The ID of the member to timeout.
time
The time in milliseconds to timeout the member for.
reason
The reason for the timeout.
hasTimeout(member: Exclude<GuildMemberResolvable, string>): false | number;

Checks if a member has a timeout.

Parameters
member
The member to check.
Returns

The time left until the timeout expires, in milliseconds, or false if the member does not have a timeout.