extra
asExtraEditMessage
to menus and their builders and button actions for updating theextra
of the message related to the menu.
- The buttons may not work after a several navigations.
CallbackQueryHandler.{setQueryHandler,setOnUnhandledQueryHandler}
functions to let other structures use/pipe the.on('callback_query')
handler set by theCBHandler.attach(ref)
. So that there would still be a way to process the context of the message while still letting theCBHandler
do its work.
MenuBuilder.buildAnotherInstance()
function to build another instance of the same menu if the menu itself is created by a function. This will cause the function to be executed again to generate the same menu through the function.
- Dynamically generated menus (by a function) might not be updated if any of
its buttons of the menu returns
{ update: true }
.
- Improved change detection of a dynamically generated menu.
- Updating a dynamic menu from a button is not updating the menu due to the updates on the same object, so the changes can't be tracked.
- Documentation for
full
andhide
properties of menu buttons. - Dynamic menu creation at the beginning. Now
inlineMenu
may take a function that generates a menu and when a button inside of that menu returns an object with itsupdate
property istrue
, the function will be executed again to re-draw the menu to replace.
- The ID of dynamically generated button was not used in comparison of change detection.
-
CallbackQueryHandler.setOnError
function to catch errors. -
Updated the type definitions of
hide
andfull
properties of a button. Now the can be a function returning a boolean value indicating their states. -
menu: IMenu
property to buttons. When a button returns a menu layout, that menu will be created and added to the tracking menus dictionary and be shown to the user. The menu will be created dynamically. -
menu: (id: string, values: any[]) => IMenu | Promise<IMenu>
property to buttons. This is a function that creates a menu dynamically and the dynamically generated id can be reached by the parameter for using it for navigation purposes. And thevalues
parameter having the previously returnedvalue
-s of the parent buttons to build the menu according to them. -
value: any
property to buttons. This will be used when building menus dynamically. -
MenuBuilder.isChanged
property indicating whether a menu has any change after it has been shown previously. -
update: boolean
property to buttons. Set this totrue
if you want your menu be built again by the provided menu builder function.
setOnError(handler: (e: Error) => void)
function toCallbackQueryHandler
.
- The return type of the
CallbackQueryHandler.attach()
function. Now, returnstrue
if the attaching to aTelegraf
instance is done for the first time.false
if it is already attached.
setOnMenuDelete(handler: (id: string) => void)
andsetOnMenuClose(handler: (menuBuilder: MenuBuilder | undefined) => void)
functions toCallbackQueryHandler
class.