@grammyjs/menu
Advanced tools
Comparing version 1.0.4 to 1.1.0
@@ -233,11 +233,2 @@ import { Context, Filter, InlineKeyboardButton, InlineKeyboardMarkup, LoginUrl, Middleware, MiddlewareObj } from "./deps.node.js"; | ||
/** | ||
* Adds a new login button. This can be used as a replacement for the | ||
* Telegram Login Widget. You must specify an HTTP URL used to automatically | ||
* authorize the user. | ||
* | ||
* @param text The text to display | ||
* @param loginUrl The login URL as string or `LoginUrl` object | ||
*/ | ||
login(text: MaybeDynamicString<C>, loginUrl: string | LoginUrl): this; | ||
/** | ||
* Adds a new text button. You may pass any number of listeners. They will | ||
@@ -292,2 +283,18 @@ * be called when the button is pressed. | ||
/** | ||
* Adds a new web app button, confer https://core.telegram.org/bots/webapps | ||
* | ||
* @param text The text to display | ||
* @param url An HTTPS URL of a Web App to be opened with additional data | ||
*/ | ||
webApp(text: string, url: string): this; | ||
/** | ||
* Adds a new login button. This can be used as a replacement for the | ||
* Telegram Login Widget. You must specify an HTTP URL used to automatically | ||
* authorize the user. | ||
* | ||
* @param text The text to display | ||
* @param loginUrl The login URL as string or `LoginUrl` object | ||
*/ | ||
login(text: MaybeDynamicString<C>, loginUrl: string | LoginUrl): this; | ||
/** | ||
* Adds a new inline query button. Telegram clients will let the user pick a | ||
@@ -294,0 +301,0 @@ * chat when this button is pressed. This will start an inline query. The |
@@ -79,3 +79,17 @@ "use strict"; | ||
} | ||
text(text, ...middleware) { | ||
return this.add(typeof text === "object" | ||
? { ...text, middleware } | ||
: { text, middleware }); | ||
} | ||
/** | ||
* Adds a new web app button, confer https://core.telegram.org/bots/webapps | ||
* | ||
* @param text The text to display | ||
* @param url An HTTPS URL of a Web App to be opened with additional data | ||
*/ | ||
webApp(text, url) { | ||
return this.add({ text, web_app: { url } }); | ||
} | ||
/** | ||
* Adds a new login button. This can be used as a replacement for the | ||
@@ -96,7 +110,2 @@ * Telegram Login Widget. You must specify an HTTP URL used to automatically | ||
} | ||
text(text, ...middleware) { | ||
return this.add(typeof text === "object" | ||
? { ...text, middleware } | ||
: { text, middleware }); | ||
} | ||
/** | ||
@@ -103,0 +112,0 @@ * Adds a new inline query button. Telegram clients will let the user pick a |
{ | ||
"name": "@grammyjs/menu", | ||
"description": "Interactive menus for grammY", | ||
"version": "1.0.4", | ||
"version": "1.1.0", | ||
"author": "KnorpelSenf", | ||
@@ -25,2 +25,3 @@ "license": "MIT", | ||
"devDependencies": { | ||
"@grammyjs/types": "^2.7.0", | ||
"deno2node": "^1.0.0" | ||
@@ -27,0 +28,0 @@ }, |
53055
9
1270
2