Pyrogram bot to automate streaming music in voice chats
Help
If you face an error, want to discuss this project or get support for it join @su_Chats.
Inspiration
Enormous and huge credits to @itayki from Israel for being with me while waiting for Mr. @TwitFace, AKA Andrew Lungers to release pytgcalls to write this bot.
Idea
From Mr. @TwitFace, AKA Andrew Lungers.
Requirements
- A computer running a Linux distribution with a desktop environment (if you are on VPS and don't have one, refer to this),
- the latest version of Telegram desktop,
pulseaudio
(installation on Ubuntu:apt install pulseaudio
),mplayer
(installation on Ubuntu:apt install mplayer
),python3
(installation on Ubuntu:apt install python3
) andpython3-pip
(installation on Ubuntu:apt install python3-pip
) installed on it.
Running
- Make sure you are not running any command as root, to avoid bulky errors.
- Clone the repository and change the dir:
git clone https://github.com/suprojects/VoiceChatPyroBot.git tgvcbot && cd tgvcbot
-
Copy
sample_config.py
toconfig.py
and make it use your credentials:API_ID
int: your api id from my.telegram.orgAPI_HASH
str: your api hash from my.telegram.orgTOKEN
str: your bot token from @BotFatherSUDO_USERS
list(int): a list of user ids which can pause, skip and change volumeLOG_GROUP
int: (optional) a group chat id to send "now playing" messages to in a non-spammy wayLANG
str: your bot language, choose an available language code in strings/DUR_LIMIT
int: max video duration in minutes for downloads -
Install the required Python packages:
pip(3) install -U -r requirements.txt
- Make sure pulseaudio is running and load a null sink named
MySink
by running:
bash pa.sh
- Run the bot:
python(3) bot.py
- Open Telegram desktop, join a voice chat and set
MySink.monitor
as your microphone, if you can't seeMySink.monitor
:- Open pulseaudio volume control (pavucontrol).
- The configurations tab.
- Turn the configs/profiles you see off.
- Once you've done the steps above, you can start using and sending commands to your bot to stream in the voice chat you are currently in with Telegram desktop!