コード例 #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
コード例 #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()
コード例 #3
0
ファイル: admins.py プロジェクト: namamuapa/callsmusic-1
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!")
コード例 #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.")
コード例 #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("تم التخطي! ↪")
コード例 #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)
コード例 #7
0
ファイル: admins.py プロジェクト: elsa-afk/callsmusic-1
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!")
コード例 #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!.")
コード例 #9
0
def on_stream_end(chat_id: int) -> None:
    queues.task_done(chat_id)
    play_next(chat_id)