diff --git a/mautrix_facebook/commands/conn.py b/mautrix_facebook/commands/conn.py index 65b1b4ff3dab8b5c5601ad8bf5b44dc25e390bda..c906f5a91950b47f98e24507219c743abdec64d6 100644 --- a/mautrix_facebook/commands/conn.py +++ b/mautrix_facebook/commands/conn.py @@ -38,7 +38,7 @@ async def disconnect(evt: CommandEvent) -> None: @command_handler(needs_auth=True, management_only=True, help_section=SECTION_CONNECTION, - help_text="Connect to Facebook Messenger") + help_text="Connect to Facebook Messenger", aliases=["reconnect"]) async def connect(evt: CommandEvent) -> None: if evt.sender.listen_task and not evt.sender.listen_task.done(): await evt.reply("You already have a Messenger MQTT connection") diff --git a/mautrix_facebook/commands/handler.py b/mautrix_facebook/commands/handler.py index 12b7e3bfe6f2b2b75d6e86bfa02c2577d71a41e6..1aa2144f8641a40a37c5a4dc76d75099c3f81424 100644 --- a/mautrix_facebook/commands/handler.py +++ b/mautrix_facebook/commands/handler.py @@ -13,7 +13,7 @@ # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see <https://www.gnu.org/licenses/>. -from typing import Awaitable, Callable, Dict, Optional, NamedTuple +from typing import Awaitable, Callable, Dict, Optional, NamedTuple, List from mautrix.bridge.commands import (HelpSection, CommandEvent as BaseCommandEvent, command_handler as base_command_handler, @@ -67,12 +67,13 @@ class CommandHandler(BaseCommandHandler): def command_handler(_func: Optional[Callable[[CommandEvent], Awaitable[Dict]]] = None, *, needs_auth: bool = True, needs_admin: bool = False, management_only: bool = False, name: Optional[str] = None, - help_text: str = "", help_args: str = "", help_section: HelpSection = None + help_text: str = "", help_args: str = "", help_section: HelpSection = None, + aliases: Optional[List[str]] = None ) -> Callable[[Callable[[CommandEvent], Awaitable[Optional[Dict]]]], CommandHandler]: - return base_command_handler(_func, management_only=management_only, name=name, - help_text=help_text, help_args=help_args, help_section=help_section, - needs_auth=needs_auth, needs_admin=needs_admin, + return base_command_handler(_func, management_only=management_only, name=name, aliases=aliases, + help_text=help_text, help_args=help_args, needs_admin=needs_admin, + help_section=help_section, needs_auth=needs_auth, _handler_class=CommandHandler) diff --git a/requirements.txt b/requirements.txt index 20c215e35309094d0e712e03c0d1ca502fffe199..fc740f19e1be8c0dda141847aeee68e31c89032d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,5 +4,5 @@ alembic>=1,<2 ruamel.yaml>=0.15.94,<0.17 commonmark>=0.8,<0.10 python-magic>=0.4,<0.5 -mautrix>=0.5.5,<0.6 +mautrix>=0.5.6,<0.6 fbchat-asyncio>=0.6.1,<0.7