mirror of
https://github.com/tiramisulabs/seyfert.git
synced 2025-07-01 20:46:08 +00:00
fix(GuildBan): issues
This commit is contained in:
parent
61dc04893d
commit
5f5902b9f6
@ -3,7 +3,7 @@ import type { GuildBanStructure, GuildStructure } from '../client';
|
||||
import type { UsingClient } from '../commands';
|
||||
import { Formatter, type MethodContext, type ObjectToLower } from '../common';
|
||||
import type { BanShorter } from '../common/shorters/bans';
|
||||
import type { APIBan, RESTGetAPIGuildBansQuery } from '../types';
|
||||
import type { APIBan, ActuallyBan, RESTGetAPIGuildBansQuery } from '../types';
|
||||
import { DiscordBase } from './extra/DiscordBase';
|
||||
|
||||
export interface GuildBan extends DiscordBase, ObjectToLower<Omit<APIBan, 'id'>> {}
|
||||
@ -11,10 +11,11 @@ export interface GuildBan extends DiscordBase, ObjectToLower<Omit<APIBan, 'id'>>
|
||||
export class GuildBan extends DiscordBase {
|
||||
constructor(
|
||||
client: UsingClient,
|
||||
data: APIBan,
|
||||
data: APIBan | ActuallyBan,
|
||||
readonly guildId: string,
|
||||
) {
|
||||
super(client, { ...data, id: data.user.id });
|
||||
const id = 'user' in data ? data.user.id : data.id;
|
||||
super(client, { ...data, id });
|
||||
}
|
||||
|
||||
create(body?: Parameters<BanShorter['create']>[2], reason?: string) {
|
||||
|
@ -861,6 +861,24 @@ export interface APIBan {
|
||||
user: APIUser;
|
||||
}
|
||||
|
||||
/**
|
||||
* @unstable Intended for future use, but not yet documented
|
||||
*/
|
||||
export interface ActuallyBan {
|
||||
/**
|
||||
* The reason for the ban
|
||||
*/
|
||||
reason: string | null;
|
||||
/**
|
||||
* The banned user
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
* The guild this ban is for
|
||||
*/
|
||||
guild_id: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#guild-widget-object
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user