Skip to content

Commit

Permalink
Code By @TheTeamAlexa
Browse files Browse the repository at this point in the history
  • Loading branch information
TheTeamAlexa authored Jan 12, 2024
1 parent 963ffc2 commit 82c0141
Showing 1 changed file with 32 additions and 61 deletions.
93 changes: 32 additions & 61 deletions AlexaMusic/plugins/bot/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,30 +117,25 @@ async def settings_back_markup(client, CallbackQuery: CallbackQuery, _):

## Audio and Video Quality
async def gen_buttons_aud(_, aud):
if aud == "STUDIO":
buttons = audio_quality_markup(_, STUDIO=True)
elif aud == "HIGH":
buttons = audio_quality_markup(_, HIGH=True)
elif aud == "MEDIUM":
buttons = audio_quality_markup(_, MEDIUM=True)
elif aud == "LOW":
buttons = audio_quality_markup(_, LOW=True)
if aud == "High":
buttons = audio_quality_markup(_, high=True)
elif aud == "Medium":
buttons = audio_quality_markup(_, medium=True)
elif aud == "Low":
buttons = audio_quality_markup(_, low=True)
return buttons


async def gen_buttons_vid(_, aud):
if aud == "QHD_2K":
buttons = video_quality_markup(_, QHD_2K=True)
elif aud == "FHD_1080p":
buttons = video_quality_markup(_, FHD_1080p=True)
elif aud == "HD_720p":
buttons = video_quality_markup(_, HD_720p=True)
elif aud == "SD_480p":
buttons = video_quality_markup(_, SD_480p=True)
elif aud == "SD_360p":
buttons = video_quality_markup(_, SD_360p=True)
if aud == "High":
buttons = video_quality_markup(_, high=True)
elif aud == "Medium":
buttons = video_quality_markup(_, medium=True)
elif aud == "Low":
buttons = video_quality_markup(_, low=True)
return buttons


# without admin rights


Expand Down Expand Up @@ -263,8 +258,7 @@ async def without_Admin_rights(client, CallbackQuery, _):


@app.on_callback_query(
filters.regex(pattern=r"^(LOW|MEDIUM|HIGH|STUDIO|SD_360p|SD_480p|HD_720p|FHD_1080p|QHD_2K)$")
& ~BANNED_USERS
filters.regex(pattern=r"^(LQA|MQA|HQA|LQV|MQV|HQV)$") & ~BANNED_USERS
)
@ActualAdminCB
async def aud_vid_cb(client, CallbackQuery, _):
Expand All @@ -273,47 +267,24 @@ async def aud_vid_cb(client, CallbackQuery, _):
await CallbackQuery.answer(_["set_cb_6"], show_alert=True)
except:
pass
if command == "LOW":
await save_audio_bitrate(CallbackQuery.message.chat.id, "LOW")
buttons = audio_quality_markup(_, LOW=True)
if command == "MEDIUM":
await save_audio_bitrate(
CallbackQuery.message.chat.id, "MEDIUM"
)
buttons = audio_quality_markup(_, MEDIUM=True)
if command == "HIGH":
await save_audio_bitrate(
CallbackQuery.message.chat.id, "HIGH"
)
buttons = audio_quality_markup(_, HIGH=True)
if command == "STUDIO":
await save_audio_bitrate(
CallbackQuery.message.chat.id, "STUDIO"
)
buttons = audio_quality_markup(_, STUDIO=True)
if command == "SD_360p":
await save_video_bitrate(CallbackQuery.message.chat.id, "SD_360p")
buttons = video_quality_markup(_, SD_360p=True)
if command == "SD_480p":
await save_video_bitrate(
CallbackQuery.message.chat.id, "SD_480p"
)
buttons = video_quality_markup(_, SD_480p=True)
if command == "HD_720p":
await save_video_bitrate(
CallbackQuery.message.chat.id, "HD_720p"
)
buttons = video_quality_markup(_, HD_720p=True)
if command == "FHD_1080p":
await save_video_bitrate(
CallbackQuery.message.chat.id, "FHD_1080p"
)
buttons = video_quality_markup(_, FHD_1080p=True)
if command == "QHD_2K":
await save_video_bitrate(
CallbackQuery.message.chat.id, "QHD_2K"
)
buttons = video_quality_markup(_, QHD_2K=True)
if command == "LQA":
await save_audio_bitrate(CallbackQuery.message.chat.id, "Low")
buttons = audio_quality_markup(_, low=True)
if command == "MQA":
await save_audio_bitrate(CallbackQuery.message.chat.id, "Medium")
buttons = audio_quality_markup(_, medium=True)
if command == "HQA":
await save_audio_bitrate(CallbackQuery.message.chat.id, "High")
buttons = audio_quality_markup(_, high=True)
if command == "LQV":
await save_video_bitrate(CallbackQuery.message.chat.id, "Low")
buttons = video_quality_markup(_, low=True)
if command == "MQV":
await save_video_bitrate(CallbackQuery.message.chat.id, "Medium")
buttons = video_quality_markup(_, medium=True)
if command == "HQV":
await save_video_bitrate(CallbackQuery.message.chat.id, "High")
buttons = video_quality_markup(_, high=True)
try:
return await CallbackQuery.edit_message_reply_markup(
reply_markup=InlineKeyboardMarkup(buttons)
Expand Down

0 comments on commit 82c0141

Please sign in to comment.