From 2b8b853feca816da8df42b6d83acdea4c90af258 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Mon, 28 Mar 2022 15:03:04 +0300 Subject: [PATCH] Add proper message when requesting to join via invite link --- mautrix_telegram/commands/telegram/misc.py | 3 +++ requirements.txt | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/mautrix_telegram/commands/telegram/misc.py b/mautrix_telegram/commands/telegram/misc.py index 2bff167c..f6d9e6f9 100644 --- a/mautrix_telegram/commands/telegram/misc.py +++ b/mautrix_telegram/commands/telegram/misc.py @@ -26,6 +26,7 @@ from telethon.errors import ( EmoticonInvalidError, InviteHashExpiredError, InviteHashInvalidError, + InviteRequestSentError, OptionsTooMuchError, TakeoutInitDelayError, UserAlreadyParticipantError, @@ -171,6 +172,8 @@ async def _join( return (await evt.sender.client(ImportChatInviteRequest(identifier))), None except UserAlreadyParticipantError: return None, await evt.reply("You are already in that chat.") + except InviteRequestSentError: + return None, await evt.reply("Invite request sent successfully.") else: channel = await evt.sender.client.get_entity(identifier) if not channel: diff --git a/requirements.txt b/requirements.txt index a9799c37..4a169e1a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,7 +6,7 @@ yarl>=1,<2 mautrix>=0.15.4,<0.16 #telethon>=1.24,<1.25 # Fork to make session storage async and update to layer 138 -tulir-telethon==1.25.0a5 +tulir-telethon==1.25.0a6 asyncpg>=0.20,<0.26 mako>=1,<2 setuptools