diff --git a/index.d.ts b/index.d.ts index 6e25c1c..b7d01e8 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1277,7 +1277,7 @@ declare namespace WAWebJS { endTime?: Date, /** The location of the event */ location?: string, - /** The type of a WhatsApp call link to generate, valid values are: `video` | `voice` */ + /** The type of a WhatsApp call link to generate, valid values are: `video` | `voice` | `none` */ callType?: string, /** * Indicates if a scheduled event should be sent as an already canceled diff --git a/src/structures/ScheduledEvent.js b/src/structures/ScheduledEvent.js index de77cc5..1d20a33 100644 --- a/src/structures/ScheduledEvent.js +++ b/src/structures/ScheduledEvent.js @@ -6,7 +6,7 @@ * @property {?string} description The scheduled event description * @property {?Date} endTime The end time of the event * @property {?string} location The location of the event - * @property {?string} callType The type of a WhatsApp call link to generate, valid values are: `video` | `voice` + * @property {?string} callType The type of a WhatsApp call link to generate, valid values are: `video` | `voice` | `none` * @property {boolean} [isEventCanceled = false] Indicates if a scheduled event should be sent as an already canceled * @property {?Array} messageSecret The custom message secret, can be used as an event ID. NOTE: it has to be a unique vector with a length of 32 */ @@ -58,10 +58,10 @@ class ScheduledEvent { }(`Empty '${propName}' parameter value is provided.`); } - if (propName === 'callType' && propValue && !['video', 'voice'].includes(propValue)) { + if (propName === 'callType' && propValue && !['video', 'voice', 'none'].includes(propValue)) { throw new class CreateScheduledEventError extends Error { constructor(m) { super(m); } - }(`Invalid '${propName}' parameter value is provided. Valid values are: 'voice' | 'video'.`); + }(`Invalid '${propName}' parameter value is provided. Valid values are: 'voice' | 'video' | 'none'.`); } return propValue; diff --git a/src/util/Injected/Utils.js b/src/util/Injected/Utils.js index 296d951..b6d08ef 100644 --- a/src/util/Injected/Utils.js +++ b/src/util/Injected/Utils.js @@ -125,7 +125,7 @@ exports.LoadUtils = () => { degreesLongitude: 0, name: eventSendOptions.location }, - eventJoinLink: await window.Store.ScheduledEventMsgUtils.createEventCallLink( + eventJoinLink: eventSendOptions.callType === 'none' ? null : await window.Store.ScheduledEventMsgUtils.createEventCallLink( startTimeTs, eventSendOptions.callType ),