async def pause(_, message: Message): chat_id = get_chat_id(message.chat) if (chat_id not in callsmusic.pytgcalls.active_calls) or ( callsmusic.pytgcalls.active_calls[chat_id] == "paused"): await message.reply_text("❗Tidak ada musik yang di putar!") else: callsmusic.pytgcalls.pause_stream(chat_id) await message.reply_text("▶️ Paused!")
async def resume(_, message: Message): chat_id = get_chat_id(message.chat) if (chat_id not in callsmusic.pytgcalls.active_calls) or ( callsmusic.pytgcalls.active_calls[chat_id] == "playing"): await message.reply_text("❗ Sedang di pause!") else: callsmusic.pytgcalls.resume_stream(chat_id) await message.reply_text("⏸ Resumed!")
async def update_admin(client, message: Message): chat_id = get_chat_id(message.chat) set( chat_id, [ member.user for member in await message.chat.get_members( filter="administrators") ], ) await message.reply_text("❇️ Admin cache refreshed!")
async def stop(_, message: Message): chat_id = get_chat_id(message.chat) if chat_id not in callsmusic.pytgcalls.active_calls: await message.reply_text("❗ Tidak ada streaming!") else: try: callsmusic.queues.clear(chat_id) except QueueEmpty: pass callsmusic.pytgcalls.leave_group_call(chat_id) await message.reply_text("❌ Stop streaming!")
async def skip(_, message: Message): global que chat_id = get_chat_id(message.chat) if chat_id not in callsmusic.pytgcalls.active_calls: await message.reply_text("❗ Tidak ada musik yang untuk di skip!") else: callsmusic.queues.task_done(chat_id) if callsmusic.queues.is_empty(chat_id): callsmusic.pytgcalls.leave_group_call(chat_id) else: callsmusic.pytgcalls.change_stream( chat_id, callsmusic.queues.get(chat_id)["file"]) qeue = que.get(chat_id) if qeue: skip = qeue.pop(0) if not qeue: return await message.reply_text( f"- Skip **{skip[0]}**\n- Sedang di putar **{qeue[0][0]}**")