Skip to content

BanShorter

Signature

export declare class BanShorter extends BaseShorter

Properties

0

No properties.

Methods

5

Methods

remove(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.
create(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.
fetch(guildId: string, userId: string, force?: boolean): Promise<GuildBanStructure>;

Fetches a ban from the guild.

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

A Promise that resolves to the fetched ban.

list(guildId: string, query?: RESTGetAPIGuildBansQuery, options?: boolean | CacheListOptions): Promise<GuildBanStructure[]>;

Lists bans in the guild using cached pagination when enabled. With both cursors, only `before` is respected.

Parameters
guildId
The ID of the guild.
query
The query parameters for listing bans.
options
Force a REST request, or override the client cache query policy. A boolean means force.
Returns

A Promise that resolves to an array of listed bans.