Comparing version 4.8.0-canary.5 to 4.8.0
@@ -92,2 +92,20 @@ "use strict"; | ||
} | ||
get webAppData() { | ||
if (!('message' in this.update && | ||
this.update.message && | ||
'web_app_data' in this.update.message)) | ||
return undefined; | ||
const { data, button_text } = this.update.message.web_app_data; | ||
return { | ||
data: { | ||
json() { | ||
return JSON.parse(data); | ||
}, | ||
text() { | ||
return data; | ||
}, | ||
}, | ||
button_text, | ||
}; | ||
} | ||
/** | ||
@@ -94,0 +112,0 @@ * @deprecated use {@link Telegram.webhookReply} |
{ | ||
"name": "telegraf", | ||
"version": "4.8.0-canary.5", | ||
"version": "4.8.0", | ||
"description": "Modern Telegram Bot Framework", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -7,3 +7,3 @@ <header> | ||
[![Bot API Version](https://img.shields.io/badge/Bot%20API-v5.7-f36caf.svg?style=flat-square)](https://core.telegram.org/bots/api) | ||
[![Bot API Version](https://img.shields.io/badge/Bot%20API-v6.0-f36caf.svg?style=flat-square)](https://core.telegram.org/bots/api) | ||
[![install size](https://flat.badgen.net/packagephobia/install/telegraf)](https://packagephobia.com/result?p=telegraf,node-telegram-bot-api) | ||
@@ -31,3 +31,3 @@ [![GitHub top language](https://img.shields.io/github/languages/top/telegraf/telegraf?style=flat-square&logo=github)](https://github.com/telegraf/telegraf) | ||
- Full [Telegram Bot API 5.7](https://core.telegram.org/bots/api) support | ||
- Full [Telegram Bot API 6.0](https://core.telegram.org/bots/api) support | ||
- [Excellent TypeScript typings](https://github.com/telegraf/telegraf/releases/tag/v4.0.0) | ||
@@ -34,0 +34,0 @@ - [Lightweight](https://packagephobia.com/result?p=telegraf,node-telegram-bot-api) |
@@ -139,2 +139,27 @@ import * as tg from './core/types/typegram' | ||
get webAppData() { | ||
if ( | ||
!( | ||
'message' in this.update && | ||
this.update.message && | ||
'web_app_data' in this.update.message | ||
) | ||
) | ||
return undefined | ||
const { data, button_text } = this.update.message.web_app_data | ||
return { | ||
data: { | ||
json<T>() { | ||
return JSON.parse(data) as T | ||
}, | ||
text() { | ||
return data | ||
}, | ||
}, | ||
button_text, | ||
} | ||
} | ||
/** | ||
@@ -141,0 +166,0 @@ * @deprecated use {@link Telegram.webhookReply} |
@@ -36,2 +36,9 @@ import * as tg from './core/types/typegram'; | ||
get passportData(): tg.PassportData | undefined; | ||
get webAppData(): { | ||
data: { | ||
json<T>(): T; | ||
text(): string; | ||
}; | ||
button_text: string; | ||
} | undefined; | ||
/** | ||
@@ -74,3 +81,3 @@ * @deprecated use {@link Telegram.webhookReply} | ||
*/ | ||
editMessageMedia(this: Context, media: tg.InputMedia, extra?: tt.ExtraEditMessageMedia): Promise<true | (tg.Update.Edited & tg.Message.AnimationMessage) | (tg.Update.Edited & tg.Message.AudioMessage) | (tg.Update.Edited & tg.Message.DocumentMessage) | (tg.Update.Edited & tg.Message.PhotoMessage) | (tg.Update.Edited & tg.Message.VideoMessage)>; | ||
editMessageMedia(this: Context, media: tg.InputMedia, extra?: tt.ExtraEditMessageMedia): Promise<true | (tg.Update.Edited & tg.Message.AnimationMessage) | (tg.Update.Edited & tg.Message.DocumentMessage) | (tg.Update.Edited & tg.Message.AudioMessage) | (tg.Update.Edited & tg.Message.PhotoMessage) | (tg.Update.Edited & tg.Message.VideoMessage)>; | ||
/** | ||
@@ -77,0 +84,0 @@ * @see https://core.telegram.org/bots/api#editmessagereplymarkup |
@@ -297,3 +297,3 @@ /// <reference types="node" /> | ||
*/ | ||
editMessageMedia(chatId: number | string | undefined, messageId: number | undefined, inlineMessageId: string | undefined, media: tg.InputMedia, extra?: tt.ExtraEditMessageMedia): Promise<true | (tg.Update.Edited & tg.Message.AnimationMessage) | (tg.Update.Edited & tg.Message.AudioMessage) | (tg.Update.Edited & tg.Message.DocumentMessage) | (tg.Update.Edited & tg.Message.PhotoMessage) | (tg.Update.Edited & tg.Message.VideoMessage)>; | ||
editMessageMedia(chatId: number | string | undefined, messageId: number | undefined, inlineMessageId: string | undefined, media: tg.InputMedia, extra?: tt.ExtraEditMessageMedia): Promise<true | (tg.Update.Edited & tg.Message.AnimationMessage) | (tg.Update.Edited & tg.Message.DocumentMessage) | (tg.Update.Edited & tg.Message.AudioMessage) | (tg.Update.Edited & tg.Message.PhotoMessage) | (tg.Update.Edited & tg.Message.VideoMessage)>; | ||
/** | ||
@@ -300,0 +300,0 @@ * Edit only the reply markup of messages sent by the bot or via the bot (for inline bots). |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
9585
0
0
447342
109