Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Format code. #128

Merged
merged 1 commit into from
Jan 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 12 additions & 18 deletions AlexaMusic/utils/decorators/play.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@
import asyncio

from pyrogram.enums import ChatMemberStatus
from pyrogram.errors import ChatAdminRequired, InviteRequestSent, UserAlreadyParticipant, UserNotParticipant
from pyrogram.errors import (
ChatAdminRequired,
InviteRequestSent,
UserAlreadyParticipant,
UserNotParticipant,
)
from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup

from config import PLAYLIST_IMG_URL, PRIVATE_BOT_MODE, adminlist
Expand All @@ -33,6 +38,7 @@

links = {}


def PlayWrapper(command):
async def wrapper(client, message):
if await is_maintenance() is False:
Expand All @@ -54,27 +60,17 @@ async def wrapper(client, message):
language = await get_lang(message.chat.id)
_ = get_string(language)
audio_telegram = (
(
message.reply_to_message.audio
or message.reply_to_message.voice
)
(message.reply_to_message.audio or message.reply_to_message.voice)
if message.reply_to_message
else None
)
video_telegram = (
(
message.reply_to_message.video
or message.reply_to_message.document
)
(message.reply_to_message.video or message.reply_to_message.document)
if message.reply_to_message
else None
)
url = await YouTube.url(message)
if (
audio_telegram is None
and video_telegram is None
and url is None
):
if audio_telegram is None and video_telegram is None and url is None:
if len(message.command) < 2:
if "stream" in message.command:
return await message.reply_text(_["str_1"])
Expand All @@ -95,9 +91,7 @@ async def wrapper(client, message):
]
]
)
return await message.reply_text(
_["general_4"], reply_markup=upl
)
return await message.reply_text(_["general_4"], reply_markup=upl)
if message.command[0][0] == "c":
chat_id = await get_cmode(message.chat.id)
if chat_id is None:
Expand Down Expand Up @@ -212,4 +206,4 @@ async def wrapper(client, message):
fplay,
)

return wrapper
return wrapper