guilded.ts
Version:
A powerful NPM module that allows you to easily interact with the Guilded API.
100 lines • 4.2 kB
TypeScript
import { APICalendarEvent, APICalendarEventCancellation, APICalendarEventEditPayload, APIMentions } from 'guilded-api-typings';
import { FetchOptions } from '../../managers/BaseManager';
import { CalendarEventRsvpManager } from '../../managers/calendarEvent/CalendarEventRsvpManager';
import { Base } from '../Base';
import { CalendarChannel } from '../channel/CalendarChannel';
/**
* Represents a calendar event on Guilded.
* @example new CalendarEvent(channel, rawEvent);
*/
export declare class CalendarEvent extends Base<number> {
readonly channel: CalendarChannel;
readonly raw: APICalendarEvent;
/** The ID of the server the calendar event belongs to. */
readonly serverId: string;
/** The ID of the channel the calendar event belongs to. */
readonly channelId: string;
/** The name of the calendar event. */
readonly name: string;
/** The description of the calendar event. */
readonly description?: string;
/** The location of the calendar event. */
readonly location?: string;
/** The url of the calendar event. */
readonly url?: string;
/** The color of the calendar event. */
readonly color?: number;
/** The limit of RSVPs of the calendar event. */
readonly rsvpLimit?: number;
/** The date the calendar event starts. */
readonly startsAt: Date;
/** The duration of the calendar event. */
readonly duration?: number;
/** Whether the calendar event is private. */
readonly isPrivate?: boolean;
/** The mentions of the calendar event. */
readonly mentions?: APIMentions;
/** The date the calendar event was created. */
readonly createdAt: Date;
/** The ID of the user that created the calendar event. */
readonly createdBy: string;
/** The cancellation of the calendar event. */
readonly cancellation?: APICalendarEventCancellation;
/** A manager of RSVPs that belong to the calendar event. */
readonly rsvps: CalendarEventRsvpManager;
/**
* @param channel The calendar channel the event belongs to.
* @param raw The raw data of the calendar event.
* @param cache Whether to cache the calendar event.
*/
constructor(channel: CalendarChannel, raw: APICalendarEvent, cache?: boolean);
/** Whether the calendar event is cached. */
get isCached(): boolean;
/** The server the calendar event belongs to. */
get server(): import("../..").Server | undefined;
/** The time until the calendar event starts. */
get startsIn(): number;
/** The date the calendar event ends. */
get endsAt(): Date;
/** The timestamp the calendar event was created. */
get createdTimestamp(): number;
/** The server member that created the calendar event. */
get author(): import("../..").ServerMember | undefined;
/** The ID of the user that created the calendar event. */
get authorId(): string;
/**
* Fetch the calendar event.
* @param options The options to fetch the calendar event with.
* @returns The fetched calendar event.
* @example event.fetch();
*/
fetch(options?: FetchOptions): Promise<CalendarEvent>;
/**
* Fetch the server the calendar event belongs to.
* @param options The options to fetch the server with.
* @returns The fetched server.
* @example event.fetchServer();
*/
fetchServer(options?: FetchOptions): Promise<import("../..").Server>;
/**
* Fetch the server member that created the calendar event.
* @param options The options to fetch the server member with.
* @returns The fetched server member.
* @example event.fetchAuthor();
*/
fetchAuthor(options?: FetchOptions): Promise<import("../..").ServerMember>;
/**
* Edit the calendar event.
* @param payload The payload of the calendar event.
* @returns The edited calendar event.
* @example event.edit({ name: 'New name' });
*/
edit(payload: APICalendarEventEditPayload): Promise<this>;
/**
* Delete the calendar event.
* @returns The deleted calendar event.
* @example event.delete();
*/
delete(): Promise<this>;
}
//# sourceMappingURL=CalendarEvent.d.ts.map