guilded.ts
Version:
A powerful NPM module that allows you to easily interact with the Guilded API.
53 lines • 1.86 kB
TypeScript
import { APIServerBan } from 'guilded-api-typings';
import { Base } from '../Base';
import { Server } from './Server';
import { User } from '../User';
import { FetchOptions } from '../../managers/BaseManager';
/**
* Represents a server ban on Guilded.
* @example new ServerBan(server, rawBan);
*/
export declare class ServerBan extends Base {
readonly server: Server;
readonly raw: APIServerBan;
/** The user the ban belongs to. */
readonly user: User;
/** The reason of the ban. */
readonly reason?: string;
/** The ID of the user that created the ban. */
readonly createdBy: string;
/** The date the ban was created. */
readonly createdAt: Date;
/**
* @param server The server the ban belongs to.
* @param raw The raw data of the server ban.
* @param cache Whether to cache the server ban.
*/
constructor(server: Server, raw: APIServerBan, cache?: boolean);
/** Whether the server ban is cached. */
get isCached(): boolean;
/** The user that created the server ban. */
get author(): User | undefined;
/** The timestamp the ban was created. */
get createdTimestamp(): number;
/**
* Fetch the server ban.
* @param options The options to fetch the server ban with.
* @returns The fetched server ban.
* @example ban.fetch();
*/
fetch(options?: FetchOptions): Promise<this>;
/**
* Fetch the server member that created the ban.
* @param options The options to fetch the server member with.
* @returns The fetched server member.
* @example ban.fetchAuthor();
*/
fetchAuthor(options?: FetchOptions): Promise<import("./ServerMember").ServerMember>;
/**
* Remove the server ban from the server.
* @example ban.remove();
*/
remove(): Promise<void>;
}
//# sourceMappingURL=ServerBan.d.ts.map