diff --git a/packages/client/src/methods/messages/forward-messages.ts b/packages/client/src/methods/messages/forward-messages.ts index 4d15d65b..276dbb0c 100644 --- a/packages/client/src/methods/messages/forward-messages.ts +++ b/packages/client/src/methods/messages/forward-messages.ts @@ -95,6 +95,14 @@ export async function forwardMessages( * Whether to forward without caption (implies {@link noAuthor}) */ noCaption?: boolean + + /** + * Whether to disallow further forwards of this message. + * + * Only for bots, works even if the target chat does not + * have content protection. + */ + forbidForwards?: boolean } ): Promise @@ -184,6 +192,14 @@ export async function forwardMessages( * Whether to forward without caption (implies {@link noAuthor}) */ noCaption?: boolean + + /** + * Whether to disallow further forwards of this message. + * + * Only for bots, works even if the target chat does not + * have content protection. + */ + forbidForwards?: boolean } ): Promise> @@ -258,6 +274,14 @@ export async function forwardMessages( * Whether to forward without caption (implies {@link noAuthor}) */ noCaption?: boolean + + /** + * Whether to disallow further forwards of this message. + * + * Only for bots, works even if the target chat does not + * have content protection. + */ + forbidForwards?: boolean } ): Promise> { if (!params) params = {} @@ -309,6 +333,7 @@ export async function forwardMessages( ), dropAuthor: params.noAuthor, dropMediaCaptions: params.noCaption, + noforwards: params.forbidForwards }) assertIsUpdatesGroup('messages.forwardMessages', res) diff --git a/packages/client/src/methods/messages/send-media-group.ts b/packages/client/src/methods/messages/send-media-group.ts index 75123ed2..48bb90f1 100644 --- a/packages/client/src/methods/messages/send-media-group.ts +++ b/packages/client/src/methods/messages/send-media-group.ts @@ -105,6 +105,14 @@ export async function sendMediaGroup( * Defaults to `false` */ clearDraft?: boolean + + /** + * Whether to disallow further forwards of this message. + * + * Only for bots, works even if the target chat does not + * have content protection. + */ + forbidForwards?: boolean } ): Promise { if (!params) params = {} @@ -180,6 +188,7 @@ export async function sendMediaGroup( scheduleDate: normalizeDate(params.schedule), replyMarkup, clearDraft: params.clearDraft, + noforwards: params.forbidForwards }) assertIsUpdatesGroup('_findMessageInUpdate', res) diff --git a/packages/client/src/methods/messages/send-media.ts b/packages/client/src/methods/messages/send-media.ts index f3b71656..0a2af2e9 100644 --- a/packages/client/src/methods/messages/send-media.ts +++ b/packages/client/src/methods/messages/send-media.ts @@ -114,6 +114,14 @@ export async function sendMedia( * Defaults to `false` */ clearDraft?: boolean + + /** + * Whether to disallow further forwards of this message. + * + * Only for bots, works even if the target chat does not + * have content protection. + */ + forbidForwards?: boolean } ): Promise { if (!params) params = {} @@ -170,6 +178,7 @@ export async function sendMedia( message, entities, clearDraft: params.clearDraft, + noforwards: params.forbidForwards }) const msg = this._findMessageInUpdate(res) diff --git a/packages/client/src/methods/messages/send-text.ts b/packages/client/src/methods/messages/send-text.ts index 30a84ed0..8630d87e 100644 --- a/packages/client/src/methods/messages/send-text.ts +++ b/packages/client/src/methods/messages/send-text.ts @@ -101,6 +101,14 @@ export async function sendText( * Defaults to `false` */ clearDraft?: boolean + + /** + * Whether to disallow further forwards of this message. + * + * Only for bots, works even if the target chat does not + * have content protection. + */ + forbidForwards?: boolean } ): Promise { if (!params) params = {} @@ -146,10 +154,8 @@ export async function sendText( message, entities, clearDraft: params.clearDraft, + noforwards: params.forbidForwards }) - // } catch (e) { - // - // } if (res._ === 'updateShortSentMessage') { const msg: tl.RawMessage = {