This is a Telegram bot that allows users to fetch audio from YouTube videos and send them as voice messages.
-
Install the required dependencies:
npm install telegraf ytdl-core axios
-
Replace
'YOUR_BOT_TOKEN'
with your actual Telegram bot token in theBOT_TOKEN
variable. -
Run the bot:
node your_bot_script.js
- Downloads the highest quality audio stream from YouTube.
- Sends the audio as a voice message with a thumbnail.
- The bot replies with a message indicating that the audio file is being downloaded before sending the voice message.
If you encounter any issues or have suggestions, please open an issue.
This project is licensed under the MIT License - see the LICENSE.md file for details.