| 10 | #Join private chat------------------------------------------------------------------------------------------------------------- |
| 11 | |
| 12 | async def join(client, invite_link): |
| 13 | try: |
| 14 | await client.join_chat(invite_link) |
| 15 | return "Successfully joined the Channel" |
| 16 | except UserAlreadyParticipant: |
| 17 | return "User is already a participant." |
| 18 | except (InviteHashInvalid, InviteHashExpired): |
| 19 | return "Could not join. Maybe your link is expired or Invalid." |
| 20 | except FloodWait: |
| 21 | return "Too many requests, try again later." |
| 22 | except Exception as e: |
| 23 | print(e) |
| 24 | return "Could not join, try joining manually." |
| 25 | |
| 26 | #Regex--------------------------------------------------------------------------------------------------------------- |
| 27 | #to get the url from event |