Skip to content

Commit

Permalink
Merge pull request #133 from TheTeamAlexa/autofix
Browse files Browse the repository at this point in the history
Format code.
  • Loading branch information
TheTeamAlexa authored Jan 15, 2024
2 parents 1471e69 + 9d33a64 commit 96bd907
Showing 1 changed file with 6 additions and 22 deletions.
28 changes: 6 additions & 22 deletions AlexaMusic/plugins/tools/reload.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,12 @@
RESTART_COMMAND = get_command("RESTART_COMMAND")


@app.on_message(
filters.command(RELOAD_COMMAND)
& filters.group
& ~BANNED_USERS
)
@app.on_message(filters.command(RELOAD_COMMAND) & filters.group & ~BANNED_USERS)
@language
async def reload_admin_cache(client, message: Message, _):
try:
chat_id = message.chat.id
admins = app.get_chat_members(
chat_id, filter=ChatMembersFilter.ADMINISTRATORS
)
admins = app.get_chat_members(chat_id, filter=ChatMembersFilter.ADMINISTRATORS)
authusers = await get_authuser_names(chat_id)
adminlist[chat_id] = []
async for user in admins:
Expand All @@ -56,11 +50,7 @@ async def reload_admin_cache(client, message: Message, _):
)


@app.on_message(
filters.command(RESTART_COMMAND)
& filters.group
& ~BANNED_USERS
)
@app.on_message(filters.command(RESTART_COMMAND) & filters.group & ~BANNED_USERS)
@AdminActual
async def restartbot(client, message: Message, _):
mystic = await message.reply_text(
Expand Down Expand Up @@ -106,9 +96,7 @@ async def close_menu(_, CallbackQuery):
return


@app.on_callback_query(
filters.regex("stop_downloading") & ~BANNED_USERS
)
@app.on_callback_query(filters.regex("stop_downloading") & ~BANNED_USERS)
@ActualAdminCB
async def stop_download(client, CallbackQuery: CallbackQuery, _):
message_id = CallbackQuery.message.id
Expand All @@ -129,16 +117,12 @@ async def stop_download(client, CallbackQuery: CallbackQuery, _):
lyrical.pop(message_id)
except:
pass
await CallbackQuery.answer(
"ᴅᴏᴡɴʟᴏᴀᴅɪɢ ᴄᴀɴᴄᴇʟʟᴇᴅ.", show_alert=True
)
await CallbackQuery.answer("ᴅᴏᴡɴʟᴏᴀᴅɪɢ ᴄᴀɴᴄᴇʟʟᴇᴅ.", show_alert=True)
return await CallbackQuery.edit_message_text(
f"ᴅᴏᴡɴʟᴏᴀᴅɪɴɢ ᴩʀᴏᴄᴇss ᴄᴀɴᴄᴇʟʟᴇᴅ ʙʏ {CallbackQuery.from_user.mention}"
)
except:
return await CallbackQuery.answer(
"ғᴀɪʟᴇᴅ ᴛᴏ ᴄᴀɴᴄᴇʟ ᴅᴏᴡɴʟᴏᴀᴅɪɴɢ...", show_alert=True
)
await CallbackQuery.answer(
"ғᴀɪʟᴇᴅ ᴛᴏ ʀᴇᴄᴏɢɴɪᴢᴇ ᴛʜᴇ ᴏɴɢᴏɪɴɢ ᴛᴀsᴋ.", show_alert=True
)
await CallbackQuery.answer("ғᴀɪʟᴇᴅ ᴛᴏ ʀᴇᴄᴏɢɴɪᴢᴇ ᴛʜᴇ ᴏɴɢᴏɪɴɢ ᴛᴀsᴋ.", show_alert=True)

0 comments on commit 96bd907

Please sign in to comment.