mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-13 18:13:29 +01:00
feat(Guild): add fetchBan and withReasons to fetchBans (#3170)
* add Guild#fetchBan() & backport BanInfo * and the typings * requested changes * typings overloads Co-Authored-By: izexi <43889168+izexi@users.noreply.github.com> * nullable reason typings Co-Authored-By: izexi <43889168+izexi@users.noreply.github.com>
This commit is contained in:
10
typings/index.d.ts
vendored
10
typings/index.d.ts
vendored
@@ -533,7 +533,10 @@ declare module 'discord.js' {
|
||||
public edit(data: GuildEditData, reason?: string): Promise<Guild>;
|
||||
public equals(guild: Guild): boolean;
|
||||
public fetchAuditLogs(options?: GuildAuditLogsFetchOptions): Promise<GuildAuditLogs>;
|
||||
public fetchBans(): Promise<Collection<Snowflake, User>>;
|
||||
public fetchBan(user: UserResolvable): Promise<BanInfo>;
|
||||
public fetchBans(withReasons?: false): Promise<Collection<Snowflake, User>>;
|
||||
public fetchBans(withReasons: true): Promise<Collection<Snowflake, BanInfo>>;
|
||||
public fetchBans(withReasons: boolean): Promise<Collection<Snowflake, BanInfo | User>>;
|
||||
public fetchEmbed(): Promise<GuildEmbedData>;
|
||||
public fetchInvites(): Promise<Collection<Snowflake, Invite>>;
|
||||
public fetchMember(user: UserResolvable, cache?: boolean): Promise<GuildMember>;
|
||||
@@ -1600,6 +1603,11 @@ declare module 'discord.js' {
|
||||
|
||||
type AwaitReactionsOptions = ReactionCollectorOptions & { errors?: string[] };
|
||||
|
||||
type BanInfo = {
|
||||
user: User;
|
||||
reason: string | null;
|
||||
};
|
||||
|
||||
type BanOptions = {
|
||||
days?: number;
|
||||
reason?: string;
|
||||
|
||||
Reference in New Issue
Block a user