merge pull request #174 from levina-lab/beta-test

fix floodwait issue
This commit is contained in:
levina 2022-02-26 12:29:04 +07:00 committed by GitHub
commit edcd46b055
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 23 deletions

View File

@ -197,20 +197,21 @@ async def play(c: Client, m: Message):
ubot = me_user.id
b = await c.get_chat_member(chat_id, ubot)
if b.status == "banned":
await m.reply_text("❌ The userbot is banned in this chat, unban the userbot first to be able to play music !")
return
invitelink = (await c.get_chat(chat_id)).invite_link
if not invitelink:
await c.export_chat_invite_link(chat_id)
try:
await m.reply_text("❌ The userbot is banned in this chat, unban the userbot first to be able to play music !")
await remove_active_chat(chat_id)
except BaseException:
pass
invitelink = (await c.get_chat(chat_id)).invite_link
if invitelink.startswith("https://t.me/+"):
invitelink = invitelink.replace(
"https://t.me/+", "https://t.me/joinchat/"
)
if not invitelink:
await c.export_chat_invite_link(chat_id)
invitelink = (await c.get_chat(chat_id)).invite_link
if invitelink.startswith("https://t.me/+"):
invitelink = invitelink.replace(
"https://t.me/+", "https://t.me/joinchat/"
)
await user.join_chat(invitelink)
await remove_active_chat(chat_id)
except UserAlreadyParticipant:
pass
except UserNotParticipant:
try:
invitelink = (await c.get_chat(chat_id)).invite_link

View File

@ -216,22 +216,23 @@ async def vplay(c: Client, m: Message):
)
try:
ubot = me_user.id
b = await c.get_chat_member(chat_id, ubot)
b = await c.get_chat_member(chat_id, ubot)
if b.status == "banned":
await m.reply_text("❌ The userbot is banned in this chat, unban the userbot first to be able to play music !")
return
invitelink = (await c.get_chat(chat_id)).invite_link
if not invitelink:
await c.export_chat_invite_link(chat_id)
try:
await m.reply_text("❌ The userbot is banned in this chat, unban the userbot first to be able to play music !")
await remove_active_chat(chat_id)
except BaseException:
pass
invitelink = (await c.get_chat(chat_id)).invite_link
if invitelink.startswith("https://t.me/+"):
invitelink = invitelink.replace(
"https://t.me/+", "https://t.me/joinchat/"
)
if not invitelink:
await c.export_chat_invite_link(chat_id)
invitelink = (await c.get_chat(chat_id)).invite_link
if invitelink.startswith("https://t.me/+"):
invitelink = invitelink.replace(
"https://t.me/+", "https://t.me/joinchat/"
)
await user.join_chat(invitelink)
await remove_active_chat(chat_id)
except UserAlreadyParticipant:
pass
except UserNotParticipant:
try:
invitelink = (await c.get_chat(chat_id)).invite_link