Hierarchy

  • ChatService

Constructors

Properties

httpRequest: BaseHttpRequest

Methods

  • Create a channel message

    Throws

    ApiError

    Parameters

    • options: {
          channelId: string;
          requestBody: {
              content?: string;
              embeds?: ChatEmbedPayload[];
              hiddenLinkPreviewUrls?: string[];
              isPrivate?: boolean;
              isSilent?: boolean;
              replyMessageIds?: string[];
          };
      }
      • channelId: string

        Channel ID to create the message in

      • requestBody: {
            content?: string;
            embeds?: ChatEmbedPayload[];
            hiddenLinkPreviewUrls?: string[];
            isPrivate?: boolean;
            isSilent?: boolean;
            replyMessageIds?: string[];
        }
        • Optional content?: string

          The content of the message

        • Optional embeds?: ChatEmbedPayload[]

          At this time, only one embed is supported per message, and attachments are not supported. If you need to send more than one embed or upload attachments, consider creating the message via a webhook.

        • Optional hiddenLinkPreviewUrls?: string[]

          Links in content to prevent unfurling as a link preview when displaying in Guilded

        • Optional isPrivate?: boolean

          If set, this message will only be seen by those mentioned or replied to

        • Optional isSilent?: boolean

          If set, this message will not notify any mentioned users or roles

        • Optional replyMessageIds?: string[]

          Message IDs to reply to

    Returns CancelablePromise<{
        message: ChatMessagePayload;
    }>

    any Success

  • Get channel messages Results returned will be ordered ascending by the message's createdAt. before and after will filter based on the message's createdAt

    Throws

    ApiError

    Parameters

    • options: {
          after?: string;
          before?: string;
          channelId: string;
          includePrivate?: boolean;
          limit?: number;
      }
      • Optional after?: string

        An ISO 8601 timestamp that will be used to filter out results for the current page. Order will be reversed when compared to before or when omitting this parameter altogether

      • Optional before?: string
      • channelId: string

        ID of the channel that the messages exist in

      • Optional includePrivate?: boolean

        Whether to include private messages between all users in response

      • Optional limit?: number

    Returns CancelablePromise<{
        messages: ChatMessagePayload[];
    }>

    any Success

  • Update a channel message

    Throws

    ApiError

    Parameters

    • options: {
          channelId: string;
          messageId: string;
          requestBody: {
              content?: string | Record<string, any>;
              embeds?: ChatEmbedPayload[];
              hiddenLinkPreviewUrls?: string[];
          };
      }
      • channelId: string

        ID of the channel that the message to be updated exists in

      • messageId: string
      • requestBody: {
            content?: string | Record<string, any>;
            embeds?: ChatEmbedPayload[];
            hiddenLinkPreviewUrls?: string[];
        }
        • Optional content?: string | Record<string, any>

          The content of the message

        • Optional embeds?: ChatEmbedPayload[]

          At this time, only one embed is supported per message, and attachments are not supported. If you need to send more than one embed or upload attachments, consider creating the message via a webhook.

        • Optional hiddenLinkPreviewUrls?: string[]

          Links in content to prevent unfurling as a link preview when displaying in Guilded

    Returns CancelablePromise<{
        message: ChatMessagePayload & {
            channelId?: string;
            content?: string;
            createdAt?: string;
            createdBy?: string;
            createdByWebhookId?: string;
            embeds?: ChatEmbedPayload[];
            groupId?: string;
            hiddenLinkPreviewUrls?: string[];
            id?: string;
            isPinned?: boolean;
            isPrivate?: boolean;
            isSilent?: boolean;
            mentions?: MentionsPayload;
            replyMessageIds?: string[];
            serverId?: string;
            type?: "default" | "system";
            updatedAt: string;
        };
    }>

    any Success

Generated using TypeDoc