- #WeWantPyTGCalls #WeWantJSTGCalls #WeWantTGCallsJS
- You can't run this on Android using Termux.
- You can't run this on iOS using iSH.
- You can't run this on Windows server (aka RDP).
- You can't run this on Windows subsystem for Linux (aka WSL).
- You can't run this on Shadow.
- You can't run this on Heroku.
- You can't run this on Google cloud shell.
If you face an error, want to discuss this project or get support for it, join it's group on Telegram.
- A computer (Debian-based Linux VPS recommmended)
- An alt Telegram account
- Bot token from @BotFather
- API ID & hash from my.telegram.org
- Python3 & pip3
- Mplayer
- A software to forward audio to tdesktop (Linux: pulseaudio, Windows: voicemeeter)
git clone https://github.com/rojserbest/VoiceChatPyroBot.git vcbot && cd vcbot
Copy config/sample_config.py
to config/config.py
and make it use your credentials (you can also give those as an arg when running bot.py):
API_ID
int: your api id from my.telegram.org
API_HASH
str: your api hash from my.telegram.org
TOKEN
str: your bot token from @BotFather
SUDO_USERS
list(int): a list of user ids which can pause, skip and change volume
MONGO_DB_URI
str: your MongoDB URI (you can get one for free in their official website, sign up, create a cluster and a database named "vcpb")
GROUP
int: the id of the group where your bot plays (not required if both USERS_MUST_JOIN
and LOG
are false)
USERS_MUST_JOIN
bool: if true, only users which are in the group can use the bot
LOG
bool: if true, now playing messages will be sent to the group
LANG
str: your bot language, choose an available language code in strings/
DUR_LIMIT
int: max video duration in minutes for downloads
pip(3) install -U -r requirements.txt
adduser music
and add it to sudoers using sudo usermod -aG sudo music
.
ℹ️ The volume command isn't working on Windows.
These are apt package manager instructions but you can install the required packages with other package managers too.
- Update and upgrade apt:
sudo apt update && sudo apt upgrade
- Install requirements:
sudo apt install xrdp pulseaudio mplayer screen
- Download tdesktop:
cd ~ && wget https://telegram.org/dl/desktop/linux -O tdesktop.tar.xz && tar -xf tdesktop.tar.xz && rm tdesktop.tar.xz
- Configure XRDP session to only start Telegram:
echo "~/Telegram/Telegram" >~/.xsession
- Enable pulseaudio service (you can skip this step if you don't have systemctl):
systemctl --user enable pulseaudio
- Restart the machine:
sudo reboot
- Start pulseaudio (you can skip this step if you did step 5):
pulseaudio --start
- Go back to directory of the clone and load a pulseaudio null sink, by running:
bash pa.sh
- Make a screen for the bot and attach to it:
screen -S vcbot
- Run the bot:
python(3) bot.py
-
Detattach from the screen by pressing CTRL+A then CTRL+D.
-
Open a remote desktop client and login to your user.
-
You should see the Telegram GUI, just login, join a voice chat and set
VoiceChatPyroBot
as your microphone. -
Done, you can now start sending commands to your bot and it'll stream in the voice chat.
These are apt package manager instructions but you can install the required packages with other package managers too.
- Update and upgrade apt:
sudo apt update && sudo apt upgrade
- Install requirements:
sudo apt install pulseaudio mplayer pavucontrol screen
-
If you have Telegram skip this step, otherwise download it here.
-
Go to directory of the clone and load a pulseaudio null sink, by running:
bash pa.sh
- Make a screen for the bot and attach to it:
screen -S vcbot
- Run the bot:
python(3) bot.py
-
Detattach from the screen by pressing CTRL+A then CTRL+D.
-
Open Telegram, join a voice chat and set
VoiceChatPyroBot
as your microphone. -
Done, you can now start sending commands to your bot and it'll stream in the voice chat.
-
Download Voicemeeter here and install it.
-
Download virtual audio cable here and install it.
-
Reboot.
-
Right click the speaker account in your taskbar, then click playback.
-
Set Voicemeeter input and Voicemeeter output as default and click OK.
-
Download mplayer here, extract it and add it to path.
-
Start Voicemeeter engine.
-
Run the bot:
python bot.py
-
Open Telegram, join a voice chat and set
Voicemeeter input
as your microphone. -
Done, you can now start sending commands to your bot and it'll stream in the voice chat.
- Open YouTube in your browser, and search for a song.
- Copy the complete video URL to clipboard and send it to your bot in private.
- Enable inline for you bot in @BotFather.
- In your bot's private, type @usernameOfYourBot followed by your YouTube search query, and click a result.
-
start
- start the bot -
song
- check the playing song -
volume
- check the current volume -
queue
- check songs in the queue -
pause
- pause the playing song (sudo users only) -
resume
- resume the paused song (sudo users only) -
play
- same as resume (sudo users only) -
skip
- skip the playing song (sudo users only) -
stream
- stream a radio (sudo users only) -
cleardownloads
- delete all downloads (sudo users only) -
playlist
- see the items in the playlist (sudo users only) -
clear_playlist
- clear the items in the playlist (sudo users only) -
play_playlist
- play the items in the playlist (sudo users only)
- Migrate to proper Database like SQLite for storing media queue and user requests.
- Keep track of previous and completed media requests.
- Add the features requested by users.