import os import requests from pyrogram import Client, filters from pyrogram.errors import UserAlreadyParticipant from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup, Message from youtube_search import YoutubeSearch from config import BOT_NAME as bn, DURATION_LIMIT, UPDATES_CHANNEL as updateschannel, que from helpers.admins import get_administrators from helpers.decorators import authorized_users_only from helpers.gets import get_file_name from modules.play import arq, cb_admin_check, generate_cover from services.callsmusic import callsmusic from services.callsmusic import client as USER from services.converter.converter import convert from services.downloaders import youtube from services.queues import queues chat_id = None # Oynatma listesini gösteren komut işleyici @Client.on_message(filters.command(["channelplaylist", "cplaylist"]) & filters.group & ~filters.edited) async def playlist(client, message): try: linked_chat = await client.get_chat(message.chat.id) linked_chat_id = linked_chat.linked_chat.id except Exception as e: await message.reply("Hata: Bu sohbet bağlantılı mı?") return global que queue = que.get(linked_chat_id) if not queue: await message.reply_text("Oynatıcı boşta") return now_playing, by = queue[0][0], queue[0][1].mention(style="md") msg = f"Şu Anda Çalan {linked_chat.linked_chat.title} kanalında\n- {now_playing}\n- İsteyen: {by}" queue.pop(0) if queue: msg += "\n\nSıra" for song in queue: name, usr = song[0], song[1].mention(style="md") msg += f"\n- {name}\n- İsteyen: {usr}\n" await message.reply_text(msg) # Mevcut ayarları gösteren komut işleyici @Client.on_message(filters.command(["channelcurrent", "ccurrent"]) & filters.group & ~filters.edited) async def display_current_settings(client, message): try: linked_chat = await client.get_chat(message.chat.id) linked_chat_id = linked_chat.linked_chat.id conv = linked_chat.linked_chat except Exception as e: await message.reply("Hata: Bu sohbet bağlantılı mı?") return queue = que.get(linked_chat_id) stats = updated_stats(conv, queue) if stats: await message.reply(stats) else: await message.reply("Bu sohbette çalışan VC örneği yok") # Oynatıcı ayarlarını kontrol eden komut işleyici @Client.on_message(filters.command(["channelplayer", "cplayer"]) & filters.group & ~filters.edited) @authorized_users_only async def control_player_settings(client, message): try: linked_chat = await client.get_chat(message.chat.id) linked_chat_id = linked_chat.linked_chat.id conv = linked_chat.linked_chat except Exception as e: await message.reply("Hata: Bu sohbet bağlantılı mı?") return queue = que.get(linked_chat_id) stats = updated_stats(conv, queue) if stats: playing = True # Oynatma durumunu burada belirleyin if playing: await message.reply(stats, reply_markup=r_ply("pause")) else: await message.reply(stats, reply_markup=r_ply("play")) else: await message.reply("Bu sohbette çalışan VC örneği yok") # Ek fonksiyonlar ve işleyiciler... def updated_stats(chat, queue, vol=100): if chat.id in callsmusic.active_chats: stats = f"**{chat.title}** ayarları\n\n" stats += f"Ses Seviyesi: {vol}%\n" stats += f"Sıradaki Şarkılar: `{len(queue)}`\n" stats += f"Şu Anda Çalan: **{queue[0][0]}**\n" stats += f"İsteyen: {queue[0][1].mention}" else: stats = None return stats def r_ply(type_): buttons = [ [ InlineKeyboardButton("⏹", "cleave"), InlineKeyboardButton("⏸", "cpuse"), InlineKeyboardButton("▶️", "cresume"), InlineKeyboardButton("⏭", "cskip"), ], [InlineKeyboardButton("Oynatma Listesi 📖", "cplaylist")], [InlineKeyboardButton("❌ Kapat", "ccls")] ] return InlineKeyboardMarkup(buttons) # Ek callback sorgu işleyicileri...