@grammyjs/types
Advanced tools
Comparing version 3.0.3 to 3.1.0
import type { Chat, User } from "./manage.js"; | ||
import type { InlineKeyboardMarkup } from "./markup.js"; | ||
import type { InlineKeyboardMarkup, WebAppInfo } from "./markup.js"; | ||
import type { Location, MessageEntity, ParseMode } from "./message.js"; | ||
@@ -671,1 +671,12 @@ import type { LabeledPrice } from "./payment.js"; | ||
} | ||
/** This object represents a button to be shown above inline query results. You must use exactly one of the optional fields. | ||
Example: An inline bot that sends YouTube videos can ask the user to connect the bot to their YouTube account to adapt search results accordingly. To do this, it displays a 'Connect your YouTube account' button above the results, or even before showing any. The user presses the button, switches to a private chat with the bot and, in doing so, passes a start parameter that instructs the bot to return an OAuth link. Once done, the bot can offer a switch_inline button so that the user can easily return to the chat where they wanted to use the bot's inline capabilities. */ | ||
export interface InlineQueryResultsButton { | ||
/** Label text on the button */ | ||
text: string; | ||
/** Description of the Web App that will be launched when the user presses the button. The Web App will be able to switch back to the inline mode using the method web_app_switch_inline_query inside the Web App. */ | ||
web_app?: WebAppInfo; | ||
/** Deep-linking parameter for the /start message sent to the bot when a user presses the button. 1-64 characters, only `A-Z`, `a-z`, `0-9`, `_` and `-` are allowed. */ | ||
start_parameter?: string; | ||
} |
@@ -363,2 +363,4 @@ import type { Location, Message, PhotoSize } from "./message.js"; | ||
invite_link?: ChatInviteLink; | ||
/** True, if the user joined the chat via a chat folder invite link */ | ||
via_chat_folder_invite_link?: boolean; | ||
} | ||
@@ -365,0 +367,0 @@ /** Represents a join request sent to a chat. */ |
@@ -41,2 +41,6 @@ import type { ChatAdministratorRights, User } from "./manage.js"; | ||
} | ||
export interface SwitchInlineChosenChatButton extends AbstractInlineKeyboardButton { | ||
/** If set, pressing the button will prompt the user to select one of their chats of the specified type, open that chat and insert the bot's username and the specified inline query in the input field */ | ||
switch_inline_query_chosen_chat: SwitchInlineQueryChosenChat; | ||
} | ||
export interface GameButton extends AbstractInlineKeyboardButton { | ||
@@ -57,3 +61,3 @@ /** Description of the game that will be launched when the user presses the button. | ||
/** This object represents one button of an inline keyboard. You must use exactly one of the optional fields. */ | ||
export type InlineKeyboardButton = InlineKeyboardButton.CallbackButton | InlineKeyboardButton.GameButton | InlineKeyboardButton.LoginButton | InlineKeyboardButton.PayButton | InlineKeyboardButton.SwitchInlineButton | InlineKeyboardButton.SwitchInlineCurrentChatButton | InlineKeyboardButton.UrlButton | InlineKeyboardButton.WebAppButton; | ||
export type InlineKeyboardButton = InlineKeyboardButton.CallbackButton | InlineKeyboardButton.GameButton | InlineKeyboardButton.LoginButton | InlineKeyboardButton.PayButton | InlineKeyboardButton.SwitchInlineButton | InlineKeyboardButton.SwitchInlineCurrentChatButton | InlineKeyboardButton.SwitchInlineChosenChatButton | InlineKeyboardButton.UrlButton | InlineKeyboardButton.WebAppButton; | ||
/** This object represents a parameter of the inline keyboard button used to automatically authorize a user. Serves as a great replacement for the Telegram Login Widget when the user is coming from Telegram. All the user needs to do is tap/click a button and confirm that they want to log in. | ||
@@ -73,2 +77,15 @@ Telegram apps support these buttons as of version 5.7. */ | ||
} | ||
/** This object represents an inline button that switches the current user to inline mode in a chosen chat, with an optional default inline query. */ | ||
export interface SwitchInlineQueryChosenChat { | ||
/** The default inline query to be inserted in the input field. If left empty, only the bot's username will be inserted */ | ||
query?: string; | ||
/** True, if private chats with users can be chosen */ | ||
allow_user_chats?: boolean; | ||
/** True, if private chats with bots can be chosen */ | ||
allow_bot_chats?: boolean; | ||
/** True, if group and supergroup chats can be chosen */ | ||
allow_group_chats?: boolean; | ||
/** True, if channel chats can be chosen */ | ||
allow_channel_chats?: boolean; | ||
} | ||
/** A placeholder, currently holds no information. Use BotFather to set up your game. */ | ||
@@ -75,0 +92,0 @@ export interface CallbackGame { |
@@ -0,3 +1,3 @@ | ||
import type { Chat, File, User } from "./manage.js"; | ||
import type { InlineKeyboardMarkup } from "./markup.js"; | ||
import type { Chat, File, User } from "./manage.js"; | ||
import type { PassportData } from "./passport.js"; | ||
@@ -246,2 +246,3 @@ import type { Invoice, SuccessfulPayment } from "./payment.js"; | ||
[inline mention of a user](tg://user?id=123456789) | ||
![👍](tg://emoji?id=5368324170671202286) | ||
`inline fixed-width code` | ||
@@ -260,2 +261,4 @@ ``` | ||
- Inside `(...)` part of inline link definition, all ')' and '\' must be escaped with a preceding '\' character. | ||
- A valid emoji must be provided as an alternative value for the custom emoji. The emoji will be shown instead of the custom emoji in places where a custom emoji cannot be displayed (e.g., system notifications) or if the message is forwarded by a non-premium user. It is recommended to use the emoji from the emoji field of the custom emoji sticker. | ||
- Custom emoji entities can only be used by bots that purchased additional usernames on Fragment. | ||
- In all other places characters '_', '*', '[', ']', '(', ')', '~', '`', '>', '#', '+', '-', '=', '|', '{', '}', '.', '!' must be escaped with the preceding character '\'. | ||
@@ -276,2 +279,3 @@ - In case of ambiguity between `italic` and `underline` entities `__` is always greadily treated from left to right as beginning or end of `underline` entity, so instead of `___italic underline___` use `___italic underline_\r__`, where `\r` is a character with code 13, which will be ignored. | ||
<a href="tg://user?id=123456789">inline mention of a user</a> | ||
<tg-emoji emoji-id="5368324170671202286">👍</tg-emoji> | ||
<code>inline fixed-width code</code> | ||
@@ -289,2 +293,4 @@ <pre>pre-formatted fixed-width code block</pre> | ||
- Programming language can't be specified for standalone `code` tags. | ||
- A valid emoji must be used as the content of the tg-emoji tag. The emoji will be shown instead of the custom emoji in places where a custom emoji cannot be displayed (e.g., system notifications) or if the message is forwarded by a non-premium user. It is recommended to use the emoji from the emoji field of the custom emoji sticker. | ||
- Custom emoji entities can only be used by bots that purchased additional usernames on Fragment. | ||
@@ -622,4 +628,6 @@ #### Markdown style | ||
} | ||
/** This object represents a service message about a user allowing a bot added to the attachment menu to write messages. Currently holds no information. */ | ||
/** This object represents a service message about a user allowing a bot to write messages after adding the bot to the attachment menu or launching a Web App from a link. */ | ||
export interface WriteAccessAllowed { | ||
/** Name of the Web App which was launched from a link */ | ||
web_app_name?: string; | ||
} | ||
@@ -626,0 +634,0 @@ /** This object represents a service message about a video chat scheduled in the chat. */ |
@@ -5,7 +5,7 @@ export * from "./api.js"; | ||
export * from "./markup.js"; | ||
export * from "./settings.js"; | ||
export * from "./message.js"; | ||
export * from "./methods.js"; | ||
export * from "./passport.js"; | ||
export * from "./payment.js"; | ||
export * from "./methods.js"; | ||
export * from "./settings.js"; | ||
export * from "./update.js"; |
{ | ||
"name": "@grammyjs/types", | ||
"version": "3.0.3", | ||
"version": "3.1.0", | ||
"description": "Telegram Bot API type declarations for grammY", | ||
@@ -5,0 +5,0 @@ "main": "mod.js", |
@@ -93,2 +93,3 @@ # Telegram Bot API types for grammY | ||
Also, without the links, it's useless anyway. | ||
The same is true for the links to more info about requesting chats and users. | ||
5. No images. | ||
@@ -95,0 +96,0 @@ Documentation strings containing an image are adjusted to make sense without the images, too. |
import type { WebAppInfo } from "./markup.js"; | ||
/** This object represents the bot's name. */ | ||
export interface BotName { | ||
/** The bot's name */ | ||
name: string; | ||
} | ||
/** This object represents the bot's description. */ | ||
@@ -3,0 +8,0 @@ export interface BotDescription { |
@@ -1,4 +0,4 @@ | ||
import type { CallbackQuery } from "./markup.js"; | ||
import type { ChosenInlineResult, InlineQuery } from "./inline.js"; | ||
import type { Chat, ChatJoinRequest, ChatMemberUpdated, User } from "./manage.js"; | ||
import type { CallbackQuery } from "./markup.js"; | ||
import type { Message, Poll, PollAnswer } from "./message.js"; | ||
@@ -5,0 +5,0 @@ import type { PreCheckoutQuery, ShippingQuery } from "./payment.js"; |
Sorry, the diff of this file is too big to display
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
280754
4123
108