UNPKG

@vonage/messages

Version:

Multi-channel messaging that integrates WhatsApp, Facebook, Viber, SMS, and MMS

58 lines 1.78 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.RCSCustom = void 0; const AbstractMessage_1 = require("../AbstractMessage"); const enums_1 = require("../../enums"); /** * Represents a custom message for RCS. * * @group RCS */ class RCSCustom extends AbstractMessage_1.AbstractMessage { /** * The channel through which the message will be sent. Always `rcs` */ channel = enums_1.Channels.RCS; /** * The type of message. For a custom message, this will always be `custom`. */ messageType = 'custom'; /** * A custom payload. The schema of a custom object can vary widely. */ custom; /** * The duration in seconds the delivery of a message will be attempted. By * default Vonage attempts delivery for 72 hours, however the maximum effective * value depends on the operator and is typically 24 - 48 hours. We recommend * this value should be kept at its default or at least 30 minutes. */ ttl; /** * Sends a custom message through RCS * * @param {RCSCustomParams} params - The parameters for creating a RCS custom message. * @example * ```ts * import { RCSCustom } from '@vonage/messages'; * * const { messageUUID } = await messagesClient.send(new RCSCustom({ * to: TO_NUMBER, * from: FROM_NUMBER, * custom: { * foo: 'bar', * } * clientRef: 'my-personal-reference', * })); * * console.log(`Message sent successfully with UUID ${messageUUID}`); * ``` */ constructor(params) { super(params); this.custom = params.custom; this.ttl = params.ttl; } } exports.RCSCustom = RCSCustom; //# sourceMappingURL=RCSCustom.js.map