Add proper message when requesting to join via invite link
This commit is contained in:
@@ -26,6 +26,7 @@ from telethon.errors import (
|
|||||||
EmoticonInvalidError,
|
EmoticonInvalidError,
|
||||||
InviteHashExpiredError,
|
InviteHashExpiredError,
|
||||||
InviteHashInvalidError,
|
InviteHashInvalidError,
|
||||||
|
InviteRequestSentError,
|
||||||
OptionsTooMuchError,
|
OptionsTooMuchError,
|
||||||
TakeoutInitDelayError,
|
TakeoutInitDelayError,
|
||||||
UserAlreadyParticipantError,
|
UserAlreadyParticipantError,
|
||||||
@@ -171,6 +172,8 @@ async def _join(
|
|||||||
return (await evt.sender.client(ImportChatInviteRequest(identifier))), None
|
return (await evt.sender.client(ImportChatInviteRequest(identifier))), None
|
||||||
except UserAlreadyParticipantError:
|
except UserAlreadyParticipantError:
|
||||||
return None, await evt.reply("You are already in that chat.")
|
return None, await evt.reply("You are already in that chat.")
|
||||||
|
except InviteRequestSentError:
|
||||||
|
return None, await evt.reply("Invite request sent successfully.")
|
||||||
else:
|
else:
|
||||||
channel = await evt.sender.client.get_entity(identifier)
|
channel = await evt.sender.client.get_entity(identifier)
|
||||||
if not channel:
|
if not channel:
|
||||||
|
|||||||
+1
-1
@@ -6,7 +6,7 @@ yarl>=1,<2
|
|||||||
mautrix>=0.15.4,<0.16
|
mautrix>=0.15.4,<0.16
|
||||||
#telethon>=1.24,<1.25
|
#telethon>=1.24,<1.25
|
||||||
# Fork to make session storage async and update to layer 138
|
# 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
|
asyncpg>=0.20,<0.26
|
||||||
mako>=1,<2
|
mako>=1,<2
|
||||||
setuptools
|
setuptools
|
||||||
|
|||||||
Reference in New Issue
Block a user