async def resume(_, message: Message): chat_id = get_chat_id(message.chat) if (chat_id not in callsmusic.active_chats) or ( callsmusic.active_chats[chat_id] == "playing"): await message.reply_text("❗ Nothing is paused!") else: callsmusic.resume(chat_id) await message.reply_text("⏸ Resumed!")
async def resume(_, message: Message): chat_id = get_chat_id(message.chat) if (chat_id not in callsmusic.active_chats) or ( callsmusic.active_chats[chat_id] == "ρℓαуιηg"): await message.reply_text("❗ ησтнιηg ιѕ ραυѕє∂!") else: callsmusic.resume(chat_id) await message.reply_text("⏸ яєѕυмє∂!")
async def resume(_, message: Message): try: conchat = await _.get_chat(message.chat.id) conid = conchat.linked_chat.id chid = conid except: await message.reply("Is chat even linked") return chat_id = chid if (chat_id not in callsmusic.active_chats) or ( callsmusic.active_chats[chat_id] == "playing"): await message.reply_text("❗ Nothing is paused!") else: callsmusic.resume(chat_id) await message.reply_text("⏸ Resumed!")
async def resume(_, message: Message): try: conchat = await _.get_chat(message.chat.id) conid = conchat.linked_chat.id chid = conid except: await message.reply("ιѕ ¢нαт єνєη ℓιηкє∂") return chat_id = chid if (chat_id not in callsmusic.active_chats) or ( callsmusic.active_chats[chat_id] == "playing" ): await message.reply_text("❗ ησтнιηg ιѕ ραυѕє∂!") else: callsmusic.resume(chat_id) await message.reply_text("⏸ яєѕυмє∂!")
async def resume(_, message: Message): try: conchat = await _.get_chat(message.chat.id) conid = conchat.linked_chat.id chid = conid except: await message.reply("Is chat even linked") return chat_id = chid (await message.reply_text("⏸ Resumed!")) if (callsmusic.resume(chat_id)) else ( await message.reply_text("❗ Nothing is paused!"))
async def m_cb(b, cb): global que if ( cb.message.chat.title.startswith("Channel Music: ") and chat.title[14:].isnumeric() ): chet_id = int(chat.title[13:]) else: chet_id = cb.message.chat.id qeue = que.get(chet_id) type_ = cb.matches[0].group(1) cb.message.chat.id m_chat = cb.message.chat the_data = cb.message.reply_markup.inline_keyboard[1][0].callback_data if type_ == "pause": if (chet_id not in callsmusic.active_chats) or ( callsmusic.active_chats[chet_id] == "paused" ): await cb.answer("Chat is not connected!", show_alert=True) else: callsmusic.pause(chet_id) await cb.answer("Music Paused!") await cb.message.edit( updated_stats(m_chat, qeue), reply_markup=r_ply("play") ) elif type_ == "play": if (chet_id not in callsmusic.active_chats) or ( callsmusic.active_chats[chet_id] == "playing" ): await cb.answer("Chat is not connected!", show_alert=True) else: callsmusic.resume(chet_id) await cb.answer("Music Resumed!") await cb.message.edit( updated_stats(m_chat, qeue), reply_markup=r_ply("pause") ) elif type_ == "playlist": queue = que.get(cb.message.chat.id) if not queue: await cb.message.edit("Player is idle") temp = [] for t in queue: temp.append(t) now_playing = temp[0][0] by = temp[0][1].mention(style="md") msg = "**Now Playing** in {}".format(cb.message.chat.title) msg += "\n- " + now_playing msg += "\n- Req by " + by temp.pop(0) if temp: msg += "\n\n" msg += "**Queue**" for song in temp: name = song[0] usr = song[1].mention(style="md") msg += f"\n- {name}" msg += f"\n- Req by {usr}\n" await cb.message.edit(msg) elif type_ == "resume": if (chet_id not in callsmusic.active_chats) or ( callsmusic.active_chats[chet_id] == "playing" ): await cb.answer("Chat is not connected or already playng", show_alert=True) else: callsmusic.resume(chet_id) await cb.answer("Music Resumed!") elif type_ == "puse": if (chet_id not in callsmusic.active_chats) or ( callsmusic.active_chats[chet_id] == "paused" ): await cb.answer("Chat is not connected or already paused", show_alert=True) else: callsmusic.pause(chet_id) await cb.answer("Music Paused!") elif type_ == "cls": await cb.answer("Closed menu") await cb.message.delete() elif type_ == "menu": stats = updated_stats(cb.message.chat, qeue) await cb.answer("Menu opened") marr = InlineKeyboardMarkup( [ [ InlineKeyboardButton("⏹", "leave"), InlineKeyboardButton("⏸", "puse"), InlineKeyboardButton("▶️", "resume"), InlineKeyboardButton("⏭", "skip"), ], [ InlineKeyboardButton("Playlist 📖", "playlist"), ], [InlineKeyboardButton("❌ Close", "cls")], ] ) await cb.message.edit(stats, reply_markup=marr) elif type_ == "skip": if qeue: qeue.pop(0) if chet_id not in callsmusic.active_chats: await cb.answer("Chat is not connected!", show_alert=True) else: queues.task_done(chet_id) if queues.is_empty(chet_id): callsmusic.stop(chet_id) await cb.message.edit("- No More Playlist..\n- Leaving VC!") else: await callsmusic.set_stream( chet_id, queues.get(chet_id)["file"] ) await cb.answer.reply_text("✅ <b>Skipped</b>") await cb.message.edit((m_chat, qeue), reply_markup=r_ply(the_data)) await cb.message.reply_text( f"- Skipped track\n- Now Playing **{qeue[0][0]}**" ) else: if chet_id in callsmusic.active_chats: try: queues.clear(chet_id) except QueueEmpty: pass await callsmusic.stop(chet_id) await cb.message.edit("Successfully Left the Chat!") else: await cb.answer("Chat is not connected!", show_alert=True)
cb.message.chat.id m_chat = cb.message.chat the_data = cb.message.reply_markup.inline_keyboard[1][0].callback_data if type_ == "cpause": await cb.answer("Music Paused!") if: callsmusic.pause(chet_id) else: await cb.answer("Chat is not connected!", show_alert=True) await cb.message.edit(updated_stats(conv, qeue), reply_markup=r_ply("play")) elif type_ == "cplay": await cb.answer("Music Resumed!") if: callsmusic.resume(chet_id) else: await cb.answer("Chat is not connected!", show_alert=True) await cb.message.edit( updated_stats(conv, qeue), reply_markup=r_ply("pause") ) elif type_ == "cplaylist": queue = que.get(cb.message.chat.id) if not queue: await cb.message.edit("Player is idle") temp = [] for t in queue: temp.append(t) now_playing = temp[0][0] by = temp[0][1].mention(style="md")
await message.reply_text("▶️ Paused!") if: callsmusic.pause(chat_id) else: await message.reply_text("❗ Nothing is playing!") @Client.on_message(command("resume") & other_filters) @errors @authorized_users_only async def resume(_, message: Message): chat_id = get_chat_id(message.chat) await message.reply_text("⏸ Resumed!") if: callsmusic.resume(chat_id) else: await message.reply_text("❗ Nothing is paused!") @Client.on_message(command("end") & other_filters) @errors @authorized_users_only async def stop(_, message: Message): chat_id = get_chat_id(message.chat) if chat_id not in callsmusic.active_chats: await message.reply_text("❗ Nothing is streaming!") else: try: queues.clear(chat_id)
async def resume(_, message: Message): chat_id = get_chat_id(message.chat) (await message.reply_text("⏸ Resumed!")) if (callsmusic.resume(chat_id)) else ( await message.reply_text("❗ Nothing is paused!"))