guildedapi-types.ts
Version:
Up to date Guilded API Typings. Contribution is welcome.
160 lines (151 loc) • 7.02 kB
text/typescript
import type * as OpenAPI from "../../schemas/v1"
export type APIChatMessageCategories = 'default' | 'system';
export type APIChatMessage = OpenAPI.components["schemas"]["ChatMessage"];
// export type APIChatMessage = {
// /** The ID of the message */
// id: string,
// /** The type of chat message. "system" messages are generated by Guilded, while "default" messages are user or bot-generated. */
// type: APIChatMessageCategories,
// /** The ID of the server */
// serverId?: string,
// /** The ID of the channel */
// channelId: string,
// /** The content of the message */
// content?: string,
// /** Links in content to prevent unfurling as a link preview when displaying in Guilded (min items 1; must have unique items true) */
// hiddenLinkPreviewUrls?: Array<string>,
// /** (min items 1; max items 10) */
// embeds?: Array<APIEmbedOptions>,
// /** Message IDs that were replied to (min items 1; max items 5) */
// replyMessageIds?: Array<string>,
// /** If set, this message will only be seen by those mentioned or replied to */
// isPrivate?: boolean,
// /** If set, this message did not notify mention or reply recipients (default `false`) */
// isSilent?: boolean,
// /** Message's mentions */
// mentions?: APIMentions,
// /** The ISO 8601 timestamp that the message was created at */
// createdAt: string,
// /** The ID of the user who created this message (Note: If this event has createdByWebhookId present, this field will still be populated, but can be ignored. In this case, the value of this field will always be Ann6LewA) */
// createdBy: string,
// /** The ID of the webhook who created this message, if it was created by a webhook */
// createdByWebhookId?: string,
// /** The ISO 8601 timestamp that the message was updated at, if relevant */
// updatedAt?: string
// }
/** Embed types. */
export type APIEmbedOptions = OpenAPI.components["schemas"]["ChatEmbed"];
// export interface APIEmbedOptions {
// /** Main header of the embed (max length 256) */
// title?: string,
// /** Subtext of the embed (max length 2048) */
// description?: string,
// /** URL to linkify the title field with (max length 1024; regex ^(?!attachment)) */
// url?: string,
// /** Decimal value of the color that the left border should be (min 0; max 16777215) */
// color?: number,
// /** A small section at the bottom of the embed */
// footer?: {
// /** URL of a small image to put in the footer (max length 1024) */
// icon_url?: string,
// /** Text of the footer (max length 2048) */
// text?: string
// },
// /** A timestamp to put in the footer */
// timestamp?: string,
// /** An image to the right of the embed's content */
// thumbnail?: {
// /** URL of the image (max length 1024) */
// url?: string
// },
// /** The main picture to associate with the embed */
// image?: {
// /** URL of the image (max length 1024) */
// url?: string
// },
// /** A small section above the title of the embed */
// author?: {
// /** Name of the author (max length 256) */
// name?: string,
// /** URL to linkify the author's name field (max length 1024; regex ^(?!attachment)) */
// url?: string,
// /** URL of a small image to display to the left of the author's name (max length 1024) */
// icon_url?: string
// },
// /** Table-like cells to add to the embed (max items 25) */
// fields?: Array<APIEmbedField>
// }
export type APIMentions = OpenAPI.components["schemas"]["Mentions"];
// export declare type APIMentions = {
// /** Info on mentioned users (min items 1) */
// users?: Array<{ id: string }>,
// /** Info on mentioned channels (min items 1) */
// channels?: Array<{ id: string }>,
// /** Info on mentioned roles (min items 1) */
// roles?: Array<{ id: number }>,
// /** If @everyone was mentioned */
// everyone?: boolean,
// /** If @here was mentioned */
// here?: boolean
// }
export type APIEmbedField = NonNullable<OpenAPI.components['schemas']['ChatEmbed']['fields']>[number];
// /** Table-like cells to add to the embed (max items 25) */
// export interface APIEmbedField {
// /** Header of the table-like cell (max length 256) */
// name: string,
// /** Subtext of the table-like cell (max length 1024) */
// value: string,
// /** If the field should wrap or not (default `false`) */
// inline?: boolean
// }
/** Types for message options. */
export type APIMessageOptions = {
/** The content of the message (min length 1; max length 4000) */
content?: string,
/** Links in content to prevent unfurling as a link preview when displaying in Guilded (min items 1; must have unique items true) */
hiddenLinkPreviewUrls?: Array<string>;
/** Embeds */
embeds?: Array<APIEmbedOptions>,
/** Message IDs to reply to (min items 1; max items 5) */
replyMessageIds?: Array<string>,
/** If set, this message will not notify any mentioned users or roles (default `false`) */
isSilent?: boolean,
/** If set, this message will only be seen by those mentioned or replied to */
isPrivate?: boolean
}
export type APIAnnouncement = OpenAPI.components["schemas"]["Announcement"];
// export interface APIAnnouncement {
// /** The ID of the announcement */
// id: string;
// /** The ID of the server */
// serverId: string;
// /** The ID of the channel */
// channelId: string;
// /** The ISO 8601 timestamp that the announcement was created at */
// createdAt: string;
// /** The ID of the user who created this announcement */
// createdBy: string;
// /** The content of the announcement */
// content: string;
// mentions?: APIMentions;
// /**The title of the announcement (min length `1`; max length `128`) */
// title: string;
// }
export type APIAnnouncementComment = OpenAPI.components["schemas"]["AnnouncementComment"];
// export interface APIAnnouncementComment {
// /** The ID of the comment (min 1) */
// id: number;
// /** The content of the announcement comment (min length 1; max length 10000) */
// content: string;
// /** The ISO 8601 timestamp that the announcement comment was created at */
// createdAt: string;
// /** The ISO 8601 timestamp that the announcement comment was updated at, if relevant */
// updatedAt?: string;
// /** The ID of the user who created this announcement comment (Note: If this event has createdByWebhookId present, this field will still be populated, but can be ignored. In this case, the value of this field will always be Ann6LewA) */
// createdBy: string;
// /** The ID of the channel */
// channelId: string;
// /** The ID of the announcement */
// announcementId: string;
// mentions?: APIMentions;
// }