some fixes

This commit is contained in:
levina 2022-01-18 20:02:17 +07:00 committed by GitHub
parent 80d5fafb9d
commit 5b14b38aa6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -83,10 +83,10 @@ async def play(c: Client, m: Message):
return return
try: try:
ubot = (await user.get_me()).id ubot = (await user.get_me()).id
b = await c.get_chat_member(m.chat.id, ubot) b = await c.get_chat_member(chat_id, ubot)
if b.status == "kicked": if b.status == "kicked":
await c.unban_chat_member(m.chat.id, ubot) await c.unban_chat_member(chat_id, ubot)
invitelink = await c.export_chat_invite_link(m.chat.id) invitelink = await c.export_chat_invite_link(chat_id)
if invitelink.startswith("https://t.me/+"): if invitelink.startswith("https://t.me/+"):
invitelink = invitelink.replace( invitelink = invitelink.replace(
"https://t.me/+", "https://t.me/joinchat/" "https://t.me/+", "https://t.me/joinchat/"
@ -94,7 +94,8 @@ async def play(c: Client, m: Message):
await ubot.join_chat(invitelink) await ubot.join_chat(invitelink)
except UserNotParticipant: except UserNotParticipant:
try: try:
invitelink = await c.export_chat_invite_link(m.chat.id) ubot = (await user.get_me()).id
invitelink = await c.export_chat_invite_link(chat_id)
if invitelink.startswith("https://t.me/+"): if invitelink.startswith("https://t.me/+"):
invitelink = invitelink.replace( invitelink = invitelink.replace(
"https://t.me/+", "https://t.me/joinchat/" "https://t.me/+", "https://t.me/joinchat/"