دستورات زیر رو برای linux بهینه کن

from pyrogram import Client # pip install pyrogram
from pyrogram import filters # pip install tgcrypto
from pyrogram.types import Message

from pytgcalls import filters as fl # pip install py-tgcalls -U
from pytgcalls import idle
from pytgcalls import PyTgCalls
from pytgcalls.types import ChatUpdate
from pytgcalls.types import GroupCallParticipant
from pytgcalls.types import MediaStream
from pytgcalls.types import Update

import os
import re

api_id = 13315602
api_hash = "21dc35844ae3c0e31faacc8f0ade17db"

proxy = {
    "scheme": "socks5",  # "socks4", "socks5" and "http" are supported
    "hostname": "127.0.0.1",
    "port": 2080,
    "username": "username",
    "password": "password"
}

phone_num = '+989115050944'

app = Client(
    "app_sesion",
    api_id=api_id,
    api_hash=api_hash,
    phone_number=phone_num,
    proxy=proxy
)

call_py = PyTgCalls(app)

@app.on_message(filters.regex('/help'))
async def play_handler(_: Client, message: Message):
    files = os.listdir()
    song_name = "لیست اهنگ ها به شرح زیر است\n"
    for name in files:
        if re.search(r"mp3",name):
            song_name += name.replace(".mp3","") + "\n"
    text = """شما با فعال کردن تماس گروه میتونین از دستور زیر استفاده کرده تا اهنگ مد نظر رو اجرا یا کنترل کنین همچنین در انتهای لیست نام اهنگ های فعلی موجود ذکر شده
/play برای اجرای اهنگ مد نظر
به طور مثال
/play Qrargah
/stop برای متوقف کردن
/pause برای استپ کردن
/resume اجرای ادامه
/change_volume برای تغییر ولوم
به طور مثال
/change_volume 50
""" + song_name
    await app.send_message(message.chat.id, text)

@app.on_message(filters.regex('/play'))
async def play_handler(_: Client, message: Message):
    song_name = message.text.replace("/play ","")
    test_stream = f'{song_name}.mp3'
    await call_py.play(
        message.chat.id,
        MediaStream(
            test_stream,
        ),
    )
    await app.send_message(message.chat.id, f"Bot Play {song_name}")
   
@app.on_message(filters.regex('/cache'))
async def cache_handler(_: Client, _m: Message):
    await app.send_message(_m.chat.id, call_py.cache_peer)

@app.on_message(filters.regex('/ping'))
async def ping_handler(_: Client, _m: Message):
    await app.send_message(_m.chat.id, call_py.ping)

@app.on_message(filters.regex('/pause'))
async def pause_handler(_: Client, message: Message):
    await call_py.pause_stream(
        message.chat.id,
    )
    await app.send_message(message.chat.id, "Bot Pause/")

@app.on_message(filters.regex('/resume'))
async def resume_handler(_: Client, message: Message):
    await call_py.resume_stream(
        message.chat.id,
    )
    await app.send_message(message.chat.id, "Bot Resume/")

@app.on_message(filters.regex('/stop'))
async def stop_handler(_: Client, message: Message):
    await call_py.leave_call(
        message.chat.id,
    )
    await app.send_message(message.chat.id, "Bot Stop/")

@app.on_message(filters.regex('/change_volume'))
async def change_volume_handler(_: Client, message: Message):
    volume = int(message.text.replace("/change_volume ",""))
    await call_py.change_volume_call(
        message.chat.id,
        volume,
    )

@app.on_message(filters.regex('/status'))
async def get_play_status(client: Client, message: Message):
    await client.send_message(
        message.chat.id,
        f'Current seconds {await call_py.played_time(message.chat.id)}',
    )


@call_py.on_update(
    fl.chat_update(
        ChatUpdate.Status.KICKED | ChatUpdate.Status.LEFT_GROUP,
    ),
)
async def kicked_handler(_: PyTgCalls, update: Update):
    print(f'Kicked from {update.chat_id} or left')


@call_py.on_update(fl.stream_end)
async def stream_end_handler(_: PyTgCalls, update: Update):
    print(f'Stream ended in {update.chat_id}', update)


@call_py.on_update(
    fl.call_participant(GroupCallParticipant.Action.JOINED),
)
async def participant_handler(_: PyTgCalls, update: Update):
    print(f'Participant joined in {update.chat_id}', update)


@call_py.on_update()
async def all_updates(_: PyTgCalls, update: Update):
    print(update)


call_py.start()
idle()