Allow command aliases to be a /command
too.
This commit is contained in:
parent
d30ed21de2
commit
e7a30d0369
@ -14,7 +14,7 @@ __author__ = "Davide Testa"
|
||||
__email__ = "davide@davte.it"
|
||||
__credits__ = ["Marco Origlia", "Nick Lee @Nickoala"]
|
||||
__license__ = "GNU General Public License v3.0"
|
||||
__version__ = "2.3.6"
|
||||
__version__ = "2.3.7"
|
||||
__maintainer__ = "Davide Testa"
|
||||
__contact__ = "t.me/davte"
|
||||
|
||||
|
@ -1696,6 +1696,12 @@ class Bot(TelegramBot, ObjectWithDatabase, MultiLanguageObject):
|
||||
)
|
||||
if aliases:
|
||||
for alias in aliases:
|
||||
if alias.startswith('/'):
|
||||
self.commands[alias.strip('/ ').lower()] = dict(
|
||||
handler=decorated_command_handler,
|
||||
authorization_level=authorization_level
|
||||
)
|
||||
else:
|
||||
self.command_aliases[alias] = decorated_command_handler
|
||||
if show_in_keyboard and (aliases or reply_keyboard_button):
|
||||
_reply_keyboard_button = reply_keyboard_button or aliases[0]
|
||||
|
Loading…
x
Reference in New Issue
Block a user