UNPKG

guilded.ts

Version:

A powerful NPM module that allows you to easily interact with the Guilded API.

106 lines 4.19 kB
import { APIChannelPayload, APIServer, ServerType } from 'guilded-api-typings'; import { Client } from '../Client'; import { Base } from '../Base'; import { ServerMemberManager } from '../../managers/server/ServerMemberManager'; import { ServerBanManager } from '../../managers/server/ServerBanManager'; import { ServerRoleManager } from '../../managers/server/ServerRoleManager'; import { FetchOptions } from '../../managers/BaseManager'; /** * Represents a server on Guilded. * @example new Server(client, rawServer); */ export declare class Server extends Base { readonly raw: APIServer; /** The ID of the user the server belongs to. */ readonly ownerId: string; /** The type of the server. */ readonly type?: ServerType; /** The name of the server. */ readonly name: string; /** The vanity URL of the server. */ readonly url?: string; /** The description of the server. */ readonly about?: string; /** The avatar of the server. */ readonly avatar?: string; /** The banner of the server. */ readonly banner?: string; /** The timezone of the server. */ readonly timezone?: string; /** Whether the server is verified. */ readonly isVerified?: boolean; /** The ID of the server's default channel. */ readonly defaultChannelId?: string; /** The date the server was created. */ readonly createdAt: Date; /** The manager of members that belong to the server. */ readonly members: ServerMemberManager; /** The manager of bans that belong to the server. */ readonly bans: ServerBanManager; /** The manager of roles that belong to the server. */ readonly roles: ServerRoleManager; /** * @param client The client the server belongs to. * @param raw The raw data of the server. * @param cache Whether to cache the server. */ constructor(client: Client, raw: APIServer, cache?: boolean); /** Whether the server is cached. */ get isCached(): boolean; /** The server member the server belongs to. */ get owner(): import("./ServerMember").ServerMember | undefined; /** Whether the server is a team server. */ get isTeam(): boolean; /** Whether the server is a organization server. */ get isOrganization(): boolean; /** Whether the server is a community server. */ get isCommunity(): boolean; /** Whether the server is a clan server. */ get isClan(): boolean; /** Whether the server is a guild server. */ get isGuild(): boolean; /** Whether the server is a friends server. */ get isFriends(): boolean; /** Whether the server is a streaming server. */ get isStreaming(): boolean; /** Whether the server is a other type. */ get isOther(): boolean; /** The server's default channel. */ get defaultChannel(): import("../..").Channel | undefined; /** * Fetch the server. * @param options The options to fetch the server with. * @returns The fetched server. * @example server.fetch(); */ fetch(options?: FetchOptions): Promise<this>; /** * Fetch the server member the server belongs to. * @param options The options to fetch the server member with. * @returns The fetched server member. * @example server.fetchOwner(); */ fetchOwner(options?: FetchOptions): Promise<import("./ServerMember").ServerMember>; /** * Fetch the server's default channel. * @param options The options to fetch the channel with. * @returns The fetched channel. * @example server.fetchDefaultChannel(); */ fetchDefaultChannel(options?: FetchOptions): Promise<import("../..").Channel> | undefined; /** * Create a channel in the server. * @param payload The payload of the channel. * @returns The created channel. * @example server.createChannel({ name: 'Chat', type: 'chat' }); */ createChannel(payload: Omit<APIChannelPayload, 'serverId'>): Promise<import("../..").Channel>; /** * Leave the server. * @returns The server. * @example server.leave(); */ leave(): Promise<void>; } export { ServerType }; //# sourceMappingURL=Server.d.ts.map