trying to fix
This commit is contained in:
parent
79909dfc05
commit
5407f70099
@ -303,8 +303,8 @@ async def stream(c: Client, m: Message):
|
|||||||
await m.reply_text("missing required permission:" + "\n\n» ❌ __Add users__")
|
await m.reply_text("missing required permission:" + "\n\n» ❌ __Add users__")
|
||||||
return
|
return
|
||||||
try:
|
try:
|
||||||
ubot = await user.get_me()
|
ubot = (await user.get_me()).id
|
||||||
b = await c.get_chat_member(chat_id, ubot.id)
|
b = await c.get_chat_member(chat_id, ubot)
|
||||||
if b.status == "kicked":
|
if b.status == "kicked":
|
||||||
await m.reply_text(
|
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.**"
|
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
|
return
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
pope = await c.export_chat_invite_link(chat_id)
|
user_id = (await user.get_me()).id
|
||||||
pepo = await c.revoke_chat_invite_link(chat_id, pope)
|
link = await c.export_chat_invite_link(chat_id)
|
||||||
await user.join_chat(pepo.invite_link)
|
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:
|
except UserAlreadyParticipant:
|
||||||
pass
|
pass
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
Loading…
Reference in New Issue
Block a user