Ejemplo n.º 1
0
def skip(chat_id: int) -> bool:
    chat_id = get_channel(chat_id)
    if chat_id not in pytgcalls.active_calls:
        return False
    queues.task_done(chat_id)
    play_next(chat_id)
    return True
Ejemplo n.º 2
0
async def skip(client, message: Message):
    if message.chat.id not in callsmusic.active_chats:
        await message.reply_text("❗️ Nothing is playing")
    else:
        queues.task_done(message.chat.id)
        chat_id = message.chat.id
        try:
            await callsmusic.cover_message[chat_id].delete()
        except:
            print('deleted')

        if queues.is_empty(message.chat.id):
            await callsmusic.stop(message.chat.id)
            m = await client.send_message(message.chat.id, "Done")
            await asyncio.sleep(3)
            await m.delete()
        else:
            song = queues.get(message.chat.id)
            input_filename = None
            m = await client.send_message(chat_id, "🔄 Processing...")
            if "file" in song.keys():
                input_filename = song["file"]
            await play_song(client,
                            m,
                            song,
                            song["requested_by"],
                            file=input_filename,
                            force=True)
            await m.delete()

        sk = await message.reply_text("Skipped.")
        await asyncio.sleep(3)
        await sk.delete()
Ejemplo n.º 3
0
async def skip(_, message: Message):
    if message.chat.id not in callsmusic.active_chats:
        await message.reply_text("Nothing is playing!")
    else:
        queues.task_done(message.chat.id)

        if queues.is_empty(message.chat.id):
            await callsmusic.stop(message.chat.id)
        else:
            await callsmusic.set_stream(message.chat.id,
                                        queues.get(message.chat.id)["file"])

        await message.reply_text("Skipped!")
Ejemplo n.º 4
0
async def skip(_, query: CallbackQuery):
    if message.chat.id not in callsmusic.active_chats:
        await query.message.reply_text("❗️ Nothing is playing")
    else:
        queues.task_done(message.chat.id)

        if queues.is_empty(message.chat.id):
            await callsmusic.stop(message.chat.id)
        else:
            await callsmusic.set_stream(message.chat.id,
                                        queues.get(message.chat.id)["file"])

        await query.message.reply_text("Skipped.")
Ejemplo n.º 5
0
async def skip(_, message: Message):
    if message.chat.id not in callsmusic.active_chats:
        await message.reply_text("لا يتم تشغيل شيء ☹️")
    else:
        queues.task_done(message.chat.id)

        if queues.is_empty(message.chat.id):
            await callsmusic.stop(message.chat.id)
        else:
            await callsmusic.set_stream(message.chat.id,
                                        queues.get(message.chat.id)["file"])

        await message.reply_text("تم التخطي! ↪")
Ejemplo n.º 6
0
async def cbskip(_, query: CallbackQuery):
     if query.message.chat.id not in callsmusic.active_chats:
        await query.edit_message_text("❗️ Nothing is playing", reply_markup=BACK_BUTTON)
     else:
        queues.task_done(query.message.chat.id)
        
        if queues.is_empty(query.message.chat.id):
            await callsmusic.stop(query.message.chat.id)
        else:
            await callsmusic.set_stream(
                query.message.chat.id, queues.get(query.message.chat.id)["file"]
            )

        await query.edit_message_text("🗑 Skipped", reply_markup=BACK_BUTTON)
Ejemplo n.º 7
0
async def skip(_, message: Message):
    if message.chat.id not in callsmusic.active_chats:
        await message.reply_text("Maaf Tidak Bisa Diskip Paksa!")
    else:
        queues.task_done(message.chat.id)

        if queues.is_empty(message.chat.id):
            await callsmusic.stop(message.chat.id)
        else:
            await callsmusic.set_stream(
                message.chat.id, queues.get(message.chat.id)["file"]
            )

        await message.reply_text("Lagu Kamu Sudah Diskip, Next Lanjut Lagu Berikutnya!")
Ejemplo n.º 8
0
async def skip(_, message: Message):
    if message.chat.id not in callsmusic.active_chats:
        await message.reply_text(
            "❗️ Tidak Bisa Dipaksakan Lanjut/Skip Lagu Berikutnya!")
    else:
        queues.task_done(message.chat.id)

        if queues.is_empty(message.chat.id):
            await callsmusic.stop(message.chat.id)
        else:
            await callsmusic.set_stream(message.chat.id,
                                        queues.get(message.chat.id)["file"])

        await message.reply_text(
            "Lagu Kamu Sudah Dinext, Sekarang Lagu Berikutnya!.")
Ejemplo n.º 9
0
def on_stream_end(chat_id: int) -> None:
    queues.task_done(chat_id)
    play_next(chat_id)