Skip to content

Commit

Permalink
😒
Browse files Browse the repository at this point in the history
  • Loading branch information
KSKOP69 committed Nov 4, 2024
1 parent 03f4e38 commit 3702017
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions AlexaMusic/core/call.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@


import asyncio
from datetime import datetime, timedelta
from typing import Union

from pyrogram import Client
Expand All @@ -24,11 +23,9 @@
from pytgcalls.exceptions import (
AlreadyJoinedError,
NoActiveGroupCall,
GroupCallNotFound,
NotInCallError,
)
from pytgcalls.types import ChatUpdate, MediaStream, Update
from pytgcalls.types.stream import StreamAudioEnded
from pytgcalls.types import StreamAudioEnded

import config
from AlexaMusic import LOGGER, YouTube, app
Expand Down Expand Up @@ -262,7 +259,7 @@ async def join_call(
chat_id,
stream,
)
except (NoActiveGroupCall, GroupCallNotFound, NotInCallError):
except NoActiveGroupCall:
try:
await self.join_assistant(original_chat_id, chat_id)
except Exception as e:
Expand All @@ -276,6 +273,10 @@ async def join_call(
raise AssistantErr(
"**ɴᴏ ᴀᴄᴛɪᴠᴇ ᴠɪᴅᴇᴏ ᴄʜᴀᴛ ғᴏᴜɴᴅ**\n\nᴩʟᴇᴀsᴇ ᴍᴀᴋᴇ sᴜʀᴇ ʏᴏᴜ sᴛᴀʀᴛᴇᴅ ᴛʜᴇ ᴠɪᴅᴇᴏᴄʜᴀᴛ."
)
except ChatAdminRequired:
raise AssistantErr(
"**ɴᴏ ᴀᴄᴛɪᴠᴇ ᴠɪᴅᴇᴏ ᴄʜᴀᴛ ғᴏᴜɴᴅ**\n\nᴩʟᴇᴀsᴇ ᴍᴀᴋᴇ sᴜʀᴇ ʏᴏᴜ sᴛᴀʀᴛᴇᴅ ᴛʜᴇ ᴠɪᴅᴇᴏᴄʜᴀᴛ."
)
except AlreadyJoinedError:
raise AssistantErr(
"**ᴀssɪsᴛᴀɴᴛ ᴀʟʀᴇᴀᴅʏ ɪɴ ᴠɪᴅᴇᴏᴄʜᴀᴛ**\n\nᴍᴜsɪᴄ ʙᴏᴛ sʏsᴛᴇᴍs ᴅᴇᴛᴇᴄᴛᴇᴅ ᴛʜᴀᴛ ᴀssɪᴛᴀɴᴛ ɪs ᴀʟʀᴇᴀᴅʏ ɪɴ ᴛʜᴇ ᴠɪᴅᴇᴏᴄʜᴀᴛ, ɪғ ᴛʜɪs ᴩʀᴏʙʟᴇᴍ ᴄᴏɴᴛɪɴᴜᴇs ʀᴇsᴛᴀʀᴛ ᴛʜᴇ ᴠɪᴅᴇᴏᴄʜᴀᴛ ᴀɴᴅ ᴛʀʏ ᴀɢᴀɪɴ."
Expand Down Expand Up @@ -595,8 +596,9 @@ async def stream_services_handler(client, update):
@self.four.on_update(fl.stream_end)
@self.five.on_update(fl.stream_end)
async def stream_end_handler1(client, update: Update):
if isinstance(update, StreamAudioEnded):
await self.change_stream(client, update.chat_id)
if not isinstance(update, StreamAudioEnded):
return
await self.change_stream(client, update.chat_id)


Alexa = Call()

0 comments on commit 3702017

Please sign in to comment.