This commit is contained in:
levina 2021-11-03 00:03:24 +07:00 committed by GitHub
parent 713e34f43d
commit 896e592498
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -76,8 +76,10 @@ async def vplay(_, m: Message):
popo = await bot.get_me() popo = await bot.get_me()
papa = popo papa = popo
pepe = papa.id pepe = papa.id
except Exception as e:
return await m.reply_text(f"error:\n\n{e}")
chat_title = m.chat.title chat_title = m.chat.title
a = await bot.get_chat_member(m.chat.id, pepe) a = await _.get_chat_member(m.chat.id, pepe)
if a.status != "administrator": if a.status != "administrator":
await m.reply_text(f"💡 To use me, I need to be an **Administrator** with the following **permissions**:\n\n» ❌ __Delete messages__\n» ❌ __Ban users__\n» ❌ __Add users__\n» ❌ __Manage voice chat__\n\nData is **updated** automatically after you **promote me**") await m.reply_text(f"💡 To use me, I need to be an **Administrator** with the following **permissions**:\n\n» ❌ __Delete messages__\n» ❌ __Ban users__\n» ❌ __Add users__\n» ❌ __Manage voice chat__\n\nData is **updated** automatically after you **promote me**")
return return
@ -105,7 +107,7 @@ async def vplay(_, m: Message):
uber = await user.get_me() uber = await user.get_me()
grab = uber grab = uber
good = grab.id good = grab.id
b = await bot.get_chat_member(m.chat.id, good) b = await _.get_chat_member(m.chat.id, good)
if b.status == "kicked": if b.status == "kicked":
await m.reply_text(f"@{ASSISTANT_NAME} **is banned in group** {chat_title}\n\n» **unban the userbot first if you want to use this bot.**") await m.reply_text(f"@{ASSISTANT_NAME} **is banned in group** {chat_title}\n\n» **unban the userbot first if you want to use this bot.**")
return return
@ -118,8 +120,8 @@ async def vplay(_, m: Message):
return return
else: else:
try: try:
pope = await bot.export_chat_invite_link(m.chat.id) pope = await _.export_chat_invite_link(m.chat.id)
pepo = await bot.revoke_chat_invite_link(m.chat.id, pope) pepo = await _.revoke_chat_invite_link(m.chat.id, pope)
await user.join_chat(pepo.invite_link) await user.join_chat(pepo.invite_link)
except UserAlreadyParticipant: except UserAlreadyParticipant:
pass pass
@ -309,8 +311,10 @@ async def vstream(_, m: Message):
popo = await bot.get_me() popo = await bot.get_me()
papa = popo papa = popo
pepe = papa.id pepe = papa.id
except Exception as e:
return await m.reply_text(f"error:\n\n{e}")
chat_title = m.chat.title chat_title = m.chat.title
a = await bot.get_chat_member(m.chat.id, pepe) a = await _.get_chat_member(m.chat.id, pepe)
if a.status != "administrator": if a.status != "administrator":
await m.reply_text(f"💡 To use me, I need to be an **Administrator** with the following **permissions**:\n\n» ❌ __Delete messages__\n» ❌ __Ban users__\n» ❌ __Add users__\n» ❌ __Manage voice chat__\n\nData is **updated** automatically after you **promote me**") await m.reply_text(f"💡 To use me, I need to be an **Administrator** with the following **permissions**:\n\n» ❌ __Delete messages__\n» ❌ __Ban users__\n» ❌ __Add users__\n» ❌ __Manage voice chat__\n\nData is **updated** automatically after you **promote me**")
return return
@ -338,7 +342,7 @@ async def vstream(_, m: Message):
uber = await user.get_me() uber = await user.get_me()
grab = uber grab = uber
good = grab.id good = grab.id
b = await bot.get_chat_member(m.chat.id, good) b = await _.get_chat_member(m.chat.id, good)
if b.status == "kicked": if b.status == "kicked":
await m.reply_text(f"@{ASSISTANT_NAME} **is banned in group** {chat_title}\n\n» **unban the userbot first if you want to use this bot.**") await m.reply_text(f"@{ASSISTANT_NAME} **is banned in group** {chat_title}\n\n» **unban the userbot first if you want to use this bot.**")
return return
@ -351,8 +355,8 @@ async def vstream(_, m: Message):
return return
else: else:
try: try:
pope = await bot.export_chat_invite_link(m.chat.id) pope = await _.export_chat_invite_link(m.chat.id)
pepo = await bot.revoke_chat_invite_link(m.chat.id, pope) pepo = await _.revoke_chat_invite_link(m.chat.id, pope)
await user.join_chat(pepo.invite_link) await user.join_chat(pepo.invite_link)
except UserAlreadyParticipant: except UserAlreadyParticipant:
pass pass