Репост из: grammY news
🎉 Release of grammY 1.20 🎉
This update brings support for the recently released Telegram Bot API 7.0.
Bot API 7.0 is the biggest release since bots were introduced in 2015. It adds a wealth of new exciting features. If you haven't already, check out the changes! Naturally, this also means that grammY just got lots of new things:
+ Added bot.reaction to handle updates about added reactions.
+ Added ctx.hasReaction to check for a reaction update.
+ Added the types ReactionContext and ReactionMiddleware.
+ Added ctx.reactions() to inspect more easily how a reaction was changed.
+ Updated all available actions on the context object to work with the new reaction updates.
+ Added ctx.react that lets bots react to the current message.
+ Added ctx.api.setMessageReaction and bot.api.setMessageReaction that let bots react to other messages.
+ Added bulk methods that can forward, copy, or delete up to 100 messages at a time.
+ Added support for chat boosts.
+ Added support for giveaways.
+ Added support for blockquotes.
+ Added ~100 new filter queries that let you handle all the new updates, and new ways to identify forwarded messages based on their origin, such "message:forward_origin:channel" to detect forwarded channel posts.
+ The emoji plugin has reached version 1.2.0 and lets you work with reactions without having to copy & paste emoji into your code.
+ The hydrate plugin has reached version 1.4.0 and lets you react to a message by calling ctx.message.react("🎉").
+ The conversations plugin has reached version 1.2.0 and lets you wait for reactions using conversation.waitForReaction("🎉").
+ The parse-mode plugin is ready to reach version 1.9.0 and will very soon let you format messages with blockquote entities.
In addition to these features, grammY was updated in many smaller places to reflect the changes to the Bot API. Even though the old options are still supported and most outdated type annotation are simply marked as deprecated—so your code will just keep on working—you should be aware that some of these changes are considered breaking changes. We therefore recommend you to update your code according to the following rules:
– AVOID { reply_to_message_id: 0 }, USE { reply_parameters: { message_id: 0 } }
– AVOID { allow_sending_without_reply: true }, USE { reply_parameters: { allow_sending_without_reply: true } }
– AVOID { disable_web_page_preview: true }, USE { link_preview_options: { is_disabled: true } }
– AVOID ":forward_date", USE ":forward_origin" in filter queries
– AVOID request_user, USE request_users in keyboard buttons
– AVOID the fields forward_from, forward_from_chat, forward_from_message_id, forward_signature, forward_sender_name, and forward_date, USE forward_origin with various options in message objects
– AVOID user_shared, USE users_shared in message objects
– AVOID user_id, USE user_ids in UsersShared objects
Phew!
One more thing. We have updated the entire docs on grammy.dev and updated all relevant code snippets (English only, translations will follow). Wanna understand in-depth how reactions work for bots? Get started here: grammy.dev/guide/reactions
Last (but not least!), grammY got a few minor improvements such as a new webhook adapter for nhttp, a more convenient way to connect to the testing environment of Telegram, and other smaller fixes and doc string improvements.
And now, get back to coding. 🤖🎉
This update brings support for the recently released Telegram Bot API 7.0.
Bot API 7.0 is the biggest release since bots were introduced in 2015. It adds a wealth of new exciting features. If you haven't already, check out the changes! Naturally, this also means that grammY just got lots of new things:
+ Added bot.reaction to handle updates about added reactions.
+ Added ctx.hasReaction to check for a reaction update.
+ Added the types ReactionContext and ReactionMiddleware.
+ Added ctx.reactions() to inspect more easily how a reaction was changed.
+ Updated all available actions on the context object to work with the new reaction updates.
+ Added ctx.react that lets bots react to the current message.
+ Added ctx.api.setMessageReaction and bot.api.setMessageReaction that let bots react to other messages.
+ Added bulk methods that can forward, copy, or delete up to 100 messages at a time.
+ Added support for chat boosts.
+ Added support for giveaways.
+ Added support for blockquotes.
+ Added ~100 new filter queries that let you handle all the new updates, and new ways to identify forwarded messages based on their origin, such "message:forward_origin:channel" to detect forwarded channel posts.
+ The emoji plugin has reached version 1.2.0 and lets you work with reactions without having to copy & paste emoji into your code.
+ The hydrate plugin has reached version 1.4.0 and lets you react to a message by calling ctx.message.react("🎉").
+ The conversations plugin has reached version 1.2.0 and lets you wait for reactions using conversation.waitForReaction("🎉").
+ The parse-mode plugin is ready to reach version 1.9.0 and will very soon let you format messages with blockquote entities.
In addition to these features, grammY was updated in many smaller places to reflect the changes to the Bot API. Even though the old options are still supported and most outdated type annotation are simply marked as deprecated—so your code will just keep on working—you should be aware that some of these changes are considered breaking changes. We therefore recommend you to update your code according to the following rules:
– AVOID { reply_to_message_id: 0 }, USE { reply_parameters: { message_id: 0 } }
– AVOID { allow_sending_without_reply: true }, USE { reply_parameters: { allow_sending_without_reply: true } }
– AVOID { disable_web_page_preview: true }, USE { link_preview_options: { is_disabled: true } }
– AVOID ":forward_date", USE ":forward_origin" in filter queries
– AVOID request_user, USE request_users in keyboard buttons
– AVOID the fields forward_from, forward_from_chat, forward_from_message_id, forward_signature, forward_sender_name, and forward_date, USE forward_origin with various options in message objects
– AVOID user_shared, USE users_shared in message objects
– AVOID user_id, USE user_ids in UsersShared objects
Phew!
One more thing. We have updated the entire docs on grammy.dev and updated all relevant code snippets (English only, translations will follow). Wanna understand in-depth how reactions work for bots? Get started here: grammy.dev/guide/reactions
Last (but not least!), grammY got a few minor improvements such as a new webhook adapter for nhttp, a more convenient way to connect to the testing environment of Telegram, and other smaller fixes and doc string improvements.
And now, get back to coding. 🤖🎉