diff --git a/AlexaMusic/core/call.py b/AlexaMusic/core/call.py index 0ea61416..f0fa597c 100644 --- a/AlexaMusic/core/call.py +++ b/AlexaMusic/core/call.py @@ -142,7 +142,11 @@ async def force_stop_stream(self, chat_id: int): pass async def skip_stream( - self, chat_id: int, link: str, video: Union[bool, str] = None, image: Union[bool, str] = None + self, + chat_id: int, + link: str, + video: Union[bool, str] = None, + image: Union[bool, str] = None, ): assistant = await group_assistant(self, chat_id) audio_stream_quality = await get_audio_bitrate(chat_id) @@ -168,10 +172,7 @@ async def skip_stream( stream, ) - - async def seek_stream( - self, chat_id, file_path, to_seek, duration, mode - ): + async def seek_stream(self, chat_id, file_path, to_seek, duration, mode): assistant = await group_assistant(self, chat_id) audio_stream_quality = await get_audio_bitrate(chat_id) video_stream_quality = await get_video_bitrate(chat_id) @@ -205,7 +206,12 @@ async def join_assistant(self, original_chat_id, chat_id): await app.unban_chat_member(chat_id, userbot.id) except: raise AssistantErr( - _["call_2"].format(config.BOT_NAME, userbot.id, userbot.mention, userbot.username), + _["call_2"].format( + config.BOT_NAME, + userbot.id, + userbot.mention, + userbot.username, + ), ) except UserNotParticipant: chat = await app.get_chat(chat_id) @@ -222,17 +228,9 @@ async def join_assistant(self, original_chat_id, chat_id): try: invitelink = chat.invite_link if invitelink is None: - invitelink = ( - await app.export_chat_invite_link( - chat_id - ) - ) + invitelink = await app.export_chat_invite_link(chat_id) except: - invitelink = ( - await app.export_chat_invite_link( - chat_id - ) - ) + invitelink = await app.export_chat_invite_link(chat_id) except ChatAdminRequired: raise AssistantErr(_["call_4"]) except Exception as e: @@ -325,9 +323,7 @@ async def join_call( counter[chat_id] = {} users = len(await assistant.get_participants(chat_id)) if users == 1: - autoend[chat_id] = datetime.now() + timedelta( - minutes=AUTO_END_TIME - ) + autoend[chat_id] = datetime.now() + timedelta(minutes=AUTO_END_TIME) async def change_stream(self, client, chat_id): check = db.get(chat_id) @@ -419,17 +415,13 @@ async def change_stream(self, client, chat_id): db[chat_id][0]["mystic"] = run db[chat_id][0]["markup"] = "tg" elif "vid_" in queued: - mystic = await app.send_message( - original_chat_id, _["call_10"] - ) + mystic = await app.send_message(original_chat_id, _["call_10"]) try: file_path, direct = await YouTube.download( videoid, mystic, videoid=True, - video=True - if str(streamtype) == "video" - else False, + video=True if str(streamtype) == "video" else False, ) except: return await mystic.edit_text( @@ -465,7 +457,7 @@ async def change_stream(self, client, chat_id): original_chat_id, text=_["call_9"], ) - theme = await check_theme(chat_id) + theme = await check_theme(chat_id) img = await gen_thumb(videoid, user_id, theme) button = stream_markup(_, videoid, chat_id) await mystic.delete() @@ -490,9 +482,7 @@ async def change_stream(self, client, chat_id): video_parameters=video_stream_quality, ) if str(streamtype) == "video" - else AudioPiped( - videoid, audio_parameters=audio_stream_quality - ) + else AudioPiped(videoid, audio_parameters=audio_stream_quality) ) try: await client.change_stream(chat_id, stream) @@ -553,9 +543,7 @@ async def change_stream(self, client, chat_id): photo=config.TELEGRAM_AUDIO_URL if str(streamtype) == "audio" else config.TELEGRAM_VIDEO_URL, - caption=_["stream_3"].format( - title, check[0]["dur"], user - ), + caption=_["stream_3"].format(title, check[0]["dur"], user), reply_markup=InlineKeyboardMarkup(button), ) db[chat_id][0]["mystic"] = run @@ -565,9 +553,7 @@ async def change_stream(self, client, chat_id): run = await app.send_photo( original_chat_id, photo=config.SOUNCLOUD_IMG_URL, - caption=_["stream_3"].format( - title, check[0]["dur"], user - ), + caption=_["stream_3"].format(title, check[0]["dur"], user), reply_markup=InlineKeyboardMarkup(button), ) db[chat_id][0]["mystic"] = run @@ -652,9 +638,9 @@ async def stream_end_handler1(client, update: Update): @self.four.on_participants_change() @self.five.on_participants_change() async def participants_change_handler(client, update: Update): - if not isinstance( - update, JoinedGroupCallParticipant - ) and not isinstance(update, LeftGroupCallParticipant): + if not isinstance(update, JoinedGroupCallParticipant) and not isinstance( + update, LeftGroupCallParticipant + ): return chat_id = update.chat_id users = counter.get(chat_id) @@ -665,9 +651,7 @@ async def participants_change_handler(client, update: Update): return counter[chat_id] = got if got == 1: - autoend[chat_id] = datetime.now() + timedelta( - minutes=AUTO_END_TIME - ) + autoend[chat_id] = datetime.now() + timedelta(minutes=AUTO_END_TIME) return autoend[chat_id] = {} else: @@ -678,11 +662,9 @@ async def participants_change_handler(client, update: Update): ) counter[chat_id] = final if final == 1: - autoend[chat_id] = datetime.now() + timedelta( - minutes=AUTO_END_TIME - ) + autoend[chat_id] = datetime.now() + timedelta(minutes=AUTO_END_TIME) return autoend[chat_id] = {} -Alexa = Call() \ No newline at end of file +Alexa = Call() diff --git a/AlexaMusic/plugins/admins/skip.py b/AlexaMusic/plugins/admins/skip.py index c9a2c9fb..d4c14baa 100644 --- a/AlexaMusic/plugins/admins/skip.py +++ b/AlexaMusic/plugins/admins/skip.py @@ -4,7 +4,6 @@ # All rights reserved. © Alisha © Alexa © Yukki - from pyrogram import filters from pyrogram.types import InlineKeyboardMarkup, Message diff --git a/AlexaMusic/utils/theme.py b/AlexaMusic/utils/theme.py index fc17e4e1..e3dc1773 100644 --- a/AlexaMusic/utils/theme.py +++ b/AlexaMusic/utils/theme.py @@ -1,4 +1,4 @@ -## this code is added by the (C) TheTeamAlexa on 7th March +## this code is added by the (C) TheTeamAlexa on 7th March # Copyright (C) 2021-2022 by Alexa_Help @ Github, < https://github.com/TheTeamAlexa >. # A Powerful Music Bot Property Of Rocks Indian Largest Chatting Group # All rights reserved. © Alisha © Alexa © Yukki