diff --git a/program/music.py b/program/music.py index 0a0d281..9e8c269 100644 --- a/program/music.py +++ b/program/music.py @@ -303,8 +303,8 @@ async def stream(c: Client, m: Message): await m.reply_text("missing required permission:" + "\n\n» ❌ __Add users__") return try: - ubot = await user.get_me() - b = await c.get_chat_member(chat_id, ubot.id) + ubot = (await user.get_me()).id + b = await c.get_chat_member(chat_id, ubot) if b.status == "kicked": await m.reply_text( f"@{ASSISTANT_NAME} **is banned in group** {m.chat.title}\n\n» **unban the userbot first if you want to use this bot.**" @@ -319,9 +319,12 @@ async def stream(c: Client, m: Message): return else: try: - pope = await c.export_chat_invite_link(chat_id) - pepo = await c.revoke_chat_invite_link(chat_id, pope) - await user.join_chat(pepo.invite_link) + user_id = (await user.get_me()).id + link = await c.export_chat_invite_link(chat_id) + if "+" in link: + link_hash = (link.replace("+", "")).split("t.me/")[1] + await ubot.join_chat(link_hash) + await c.promote_member(chat_id, user_id) except UserAlreadyParticipant: pass except Exception as e: