commit
edcd46b055
@ -197,20 +197,21 @@ async def play(c: Client, m: Message):
|
|||||||
ubot = me_user.id
|
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":
|
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 !")
|
try:
|
||||||
return
|
await m.reply_text("❌ The userbot is banned in this chat, unban the userbot first to be able to play music !")
|
||||||
invitelink = (await c.get_chat(chat_id)).invite_link
|
await remove_active_chat(chat_id)
|
||||||
if not invitelink:
|
except BaseException:
|
||||||
await c.export_chat_invite_link(chat_id)
|
pass
|
||||||
invitelink = (await c.get_chat(chat_id)).invite_link
|
invitelink = (await c.get_chat(chat_id)).invite_link
|
||||||
if invitelink.startswith("https://t.me/+"):
|
if not invitelink:
|
||||||
invitelink = invitelink.replace(
|
await c.export_chat_invite_link(chat_id)
|
||||||
"https://t.me/+", "https://t.me/joinchat/"
|
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 user.join_chat(invitelink)
|
||||||
await remove_active_chat(chat_id)
|
await remove_active_chat(chat_id)
|
||||||
except UserAlreadyParticipant:
|
|
||||||
pass
|
|
||||||
except UserNotParticipant:
|
except UserNotParticipant:
|
||||||
try:
|
try:
|
||||||
invitelink = (await c.get_chat(chat_id)).invite_link
|
invitelink = (await c.get_chat(chat_id)).invite_link
|
||||||
|
@ -218,20 +218,21 @@ async def vplay(c: Client, m: Message):
|
|||||||
ubot = me_user.id
|
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":
|
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 !")
|
try:
|
||||||
return
|
await m.reply_text("❌ The userbot is banned in this chat, unban the userbot first to be able to play music !")
|
||||||
invitelink = (await c.get_chat(chat_id)).invite_link
|
await remove_active_chat(chat_id)
|
||||||
if not invitelink:
|
except BaseException:
|
||||||
await c.export_chat_invite_link(chat_id)
|
pass
|
||||||
invitelink = (await c.get_chat(chat_id)).invite_link
|
invitelink = (await c.get_chat(chat_id)).invite_link
|
||||||
if invitelink.startswith("https://t.me/+"):
|
if not invitelink:
|
||||||
invitelink = invitelink.replace(
|
await c.export_chat_invite_link(chat_id)
|
||||||
"https://t.me/+", "https://t.me/joinchat/"
|
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 user.join_chat(invitelink)
|
||||||
await remove_active_chat(chat_id)
|
await remove_active_chat(chat_id)
|
||||||
except UserAlreadyParticipant:
|
|
||||||
pass
|
|
||||||
except UserNotParticipant:
|
except UserNotParticipant:
|
||||||
try:
|
try:
|
||||||
invitelink = (await c.get_chat(chat_id)).invite_link
|
invitelink = (await c.get_chat(chat_id)).invite_link
|
||||||
|
Loading…
Reference in New Issue
Block a user