TGViewer
star source • استار سورس star source • استار سورس @star_sourcee · 26.4K subscribers
Post #317 1.82K
#تیکه_کد
▫️ تبدیل موزیک به وویس و برعکس

▫️ برای اینکه بتونیم هر آهنگی که حجمش زیاده رو کم کنیم میتونیم اونو به وویس تبدیل کنیم و برعکس!
▫️برای این کار ابتدا فانکشن های زیر رو در بات قرار بدید.

function sendaudio($chat_id, $audio, $caption){
bot('sendaudio',[
'chat_id'=>$chat_id,
'audio'=>$audio,
'caption'=>$caption,
]);
}
function sendvoice($chat_id, $voice, $caption){
bot('sendvoice',[
'chat_id'=>$chat_id,
'voice'=>$voice,
'caption'=>$caption,
]);
}

▫️ و سپس تیکه کد زیر :

elseif(isset($message->audio)){
$audio = $message->audio;
$file = $audio->file_id;
$get = bot('getfile',['file_id'=>$file]);
$patch = $get->result->file_path;
file_put_contents('music.ogg',file_get_contents('https://api.telegram.org/file/bot'.$API_KEY.'/'.$patch));
sendvoice($chat_id , new CURLFile('music.ogg'), "ok done!");
}
elseif(isset($message->voice)){
$voice = $message->voice;
$file = $voice->file_id;
$get = bot('getfile',['file_id'=>$file]);
$patch = $get->result->file_path;
file_put_contents('music.mp3',file_get_contents('https://api.telegram.org/file/bot'.$API_KEY.'/'.$patch));
sendaudio($chat_id , new CURLFile('music.mp3'), "ok done!");
}

▫️ اگر  هر موزیک یا وویسی برای ربات فرستاده بشه اونو تبدیل به وویس یا موزیک میکنه.
▫️ متغیرهای لازم رو با باتتون ست کنید.

▫️ . @Star_Sourcee
More from @star_sourcee
  1. Aug 4, 2026📑 | سورس ربات ویروس توتال | ربات شناسایی فایل های مخرب 🔐 | ورژن : 3 💻 | زبان : PHP 8+ �…
  2. May 28, 2026سه ماه، مدت زمان کمی نیست!
  3. May 26, 2026‏شمارش معکوس برای حذف سوپراپلیکیشنای ایرانی... ⏳️
  4. May 26, 2026بالاخره بعد از ٣ ماه قطعی گسترده، روند اتصال اینترنت رسماً شروع شده و داره خیلی خوب پیش می…
  5. May 22, 2026بازی خیلی سادس!
  6. May 21, 2026کانفیگ جدید❗️ {دارای تک سرور فعال} با پروکسی ترکیب کنید https://t.me/proxy?server=31.47.51…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →