You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Allows to look up menu instances via the context object. They no longer have to be in scope.
This way, the menus can be defined in one file, and then imported and installed on the context object in the main file. They will be available in every other middleware in the code base.
This requires a new context flavour for menus, something that we were able to avoid thus far. However, given that it only really is necessary to be installed when that function is used, this should not be much of an issue.
Regarding performance, a menu instance lookup is going to take O(n) time with n being the number of menu structures. Note that this number is equivalent to the number of menus passed to bot.use calls.
The text was updated successfully, but these errors were encountered:
KnorpelSenf
changed the title
Implement ctx.menu.at
feat: Implement ctx.menu.atDec 2, 2021
Allows to look up menu instances via the context object. They no longer have to be in scope.
This way, the menus can be defined in one file, and then imported and installed on the context object in the main file. They will be available in every other middleware in the code base.
This requires a new context flavour for menus, something that we were able to avoid thus far. However, given that it only really is necessary to be installed when that function is used, this should not be much of an issue.
The usage will be as follows.
Regarding performance, a menu instance lookup is going to take
O(n)
time withn
being the number of menu structures. Note that this number is equivalent to the number of menus passed tobot.use
calls.The text was updated successfully, but these errors were encountered: