ok
This commit is contained in:
parent
17f40cff37
commit
8e3666eb52
@ -1,7 +1,6 @@
|
|||||||
from driver.veez import call_py
|
|
||||||
from pytgcalls import PyTgCalls
|
|
||||||
from pytgcalls.types import Update
|
|
||||||
from driver.queues import QUEUE, clear_queue, get_queue, pop_an_item
|
from driver.queues import QUEUE, clear_queue, get_queue, pop_an_item
|
||||||
|
from driver.veez import call_py
|
||||||
|
from pytgcalls.types import Update
|
||||||
from pytgcalls.types.input_stream import AudioPiped, AudioVideoPiped
|
from pytgcalls.types.input_stream import AudioPiped, AudioVideoPiped
|
||||||
from pytgcalls.types.input_stream.quality import (
|
from pytgcalls.types.input_stream.quality import (
|
||||||
HighQualityAudio,
|
HighQualityAudio,
|
||||||
@ -68,20 +67,27 @@ async def skip_item(chat_id, h):
|
|||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
|
||||||
|
@call_py.on_kicked()
|
||||||
|
async def kicked_handler(_, chat_id: int):
|
||||||
|
if chat_id in QUEUE:
|
||||||
|
clear_queue(chat_id)
|
||||||
|
|
||||||
|
|
||||||
|
@call_py.on_closed_voice_chat()
|
||||||
|
async def closed_voice_chat_handler(_, chat_id: int):
|
||||||
|
if chat_id in QUEUE:
|
||||||
|
clear_queue(chat_id)
|
||||||
|
|
||||||
|
|
||||||
|
@call_py.on_left()
|
||||||
|
async def left_handler(_, chat_id: int):
|
||||||
|
if chat_id in QUEUE:
|
||||||
|
clear_queue(chat_id)
|
||||||
|
|
||||||
|
|
||||||
@call_py.on_stream_end()
|
@call_py.on_stream_end()
|
||||||
async def on_end_handler(_, u: Update):
|
async def stream_end_handler(_, u: Update):
|
||||||
if isinstance(u, StreamAudioEnded) or isinstance(u, StreamVideoEnded):
|
if isinstance(u, StreamAudioEnded) or isinstance(u, StreamVideoEnded):
|
||||||
chat_id = u.chat_id
|
chat_id = u.chat_id
|
||||||
print(chat_id)
|
print(chat_id)
|
||||||
await skip_current_song(chat_id)
|
await skip_current_song(chat_id)
|
||||||
|
|
||||||
|
|
||||||
@call_py.on_closed_voice_chat()
|
|
||||||
async def closed_handler(client: PyTgCalls, chat_id: int):
|
|
||||||
if chat_id in QUEUE:
|
|
||||||
clear_queue(chat_id)
|
|
||||||
|
|
||||||
@call_py.on_kicked()
|
|
||||||
async def kicked_handler(client: PyTgCalls, chat_id: int) -> None:
|
|
||||||
if chat_id in QUEUE:
|
|
||||||
clear_queue(chat_id)
|
|
||||||
|
Loading…
Reference in New Issue
Block a user