From f89d61a15e15a0b3622b81c590f6cd45bba02f19 Mon Sep 17 00:00:00 2001 From: TheHydrogen <87415292+azimazizov9150@users.noreply.github.com> Date: Tue, 11 Jan 2022 03:10:52 +0400 Subject: [PATCH] Fixing song command in private chats --- Yukki/Plugins/Song.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/Yukki/Plugins/Song.py b/Yukki/Plugins/Song.py index ffc8c5219..d100be216 100644 --- a/Yukki/Plugins/Song.py +++ b/Yukki/Plugins/Song.py @@ -32,11 +32,17 @@ ) @PermissionCheck async def play(_, message: Message): - if message.sender_chat: - return await message.reply_text( - "You're an __Anonymous Admin__ in this Chat Group!\nRevert back to User Account From Admin Rights." - ) - await message.delete() + if message.chat.type == "private": + pass + else: + if message.sender_chat: + return await message.reply_text( + "You're an __Anonymous Admin__ in this Chat Group!\nRevert back to User Account From Admin Rights." + ) + try: + await message.delete() + except: + pass url = get_url(message) if url: mystic = await message.reply_text("🔄 Processing URL... Please Wait!")