Add some command aliases

This commit is contained in:
Andrew Ferrazzutti 2022-05-09 03:25:15 -04:00
parent 37101f42c1
commit 5b16694f78
2 changed files with 6 additions and 3 deletions

View File

@ -277,7 +277,7 @@ async def _handle_login_failure(evt: CommandEvent, e: Exception) -> None:
needs_auth=True, needs_auth=True,
management_only=True, management_only=True,
help_section=SECTION_AUTH, help_section=SECTION_AUTH,
help_text="Delete saved login password, if it was saved" help_text="Delete saved login password, if it was saved",
) )
async def forget_password(evt: CommandEvent) -> None: async def forget_password(evt: CommandEvent) -> None:
creds = await LoginCredential.get_by_mxid(evt.sender.mxid) creds = await LoginCredential.get_by_mxid(evt.sender.mxid)
@ -337,7 +337,8 @@ async def reset_device(evt: CommandEvent) -> None:
@command_handler( @command_handler(
needs_auth=False, needs_auth=False,
help_section=SECTION_AUTH, help_section=SECTION_AUTH,
help_text="When logging in, automatically log out of any other existing KakaoTalk session" help_text="When logging in, automatically log out of any other existing KakaoTalk session",
aliases=["enable-force-login"],
) )
async def enable_forced_login(evt: CommandEvent) -> None: async def enable_forced_login(evt: CommandEvent) -> None:
if evt.sender.force_login: if evt.sender.force_login:
@ -350,7 +351,8 @@ async def enable_forced_login(evt: CommandEvent) -> None:
@command_handler( @command_handler(
needs_auth=False, needs_auth=False,
help_section=SECTION_AUTH, help_section=SECTION_AUTH,
help_text="When logging in, ask before logging out of another existing KakaoTalk session, if one exists" help_text="When logging in, ask before logging out of another existing KakaoTalk session, if one exists",
aliases=["disable-force-login"],
) )
async def disable_forced_login(evt: CommandEvent) -> None: async def disable_forced_login(evt: CommandEvent) -> None:
if not evt.sender.force_login: if not evt.sender.force_login:

View File

@ -76,6 +76,7 @@ async def ping(evt: CommandEvent) -> None:
help_section=SECTION_CONNECTION, help_section=SECTION_CONNECTION,
help_text="(Re)connect to KakaoTalk chats & sync any missed chat updates", help_text="(Re)connect to KakaoTalk chats & sync any missed chat updates",
help_args="[_number of channels to sync_]", help_args="[_number of channels to sync_]",
aliases=["connect"],
) )
async def sync(evt: CommandEvent) -> None: async def sync(evt: CommandEvent) -> None:
try: try: