A multipurpose telegram userbot which can be used for moderation as well as playing music in telegram vc.
Put API_ID and API_HASH in .env. Get API ID and hash from here by creating an application if haven't already created.
- Using Pip
- Clone repository
git clone https://github.com/SurfyPenguin/telegram-userbot.git- Create virutal environment
python3 -m venv .venv- Activate
.venv
source .venv/bin/activate- Install dependencies
pip install .- Run project
python3 userbot/main.py- Using uv
- Clone repository
git clone https://github.com/SurfyPenguin/telegram-userbot.git- Create virtual environment
uv venv- Install dependencies
uv sync- Run project
uv run userbot/main.pytelegram-userbot/
├── data
│ └── feds.json
├── plugins
│ ├── admin.py
│ ├── federations.py
│ ├── music.py
│ ├── ping.py
│ └── stats.py
├── pyproject.toml
├── README.md
├── userbot
│ ├── config.py
│ ├── __init__.py
│ └── main.py
└── uv.lock- Prefixes can be changed in
config.py ?-> Admin commands!-> Music commands
/purge- Send?purgewhile replying to a message./info- Send?infowhile replying to a message, or mentioning username?info <username or id>./spurge- Same as?purgeexcept silent purge will not send number of deleted messages in chat./ping- Pings the chat in which?pingis sent./pingdc-?pingdcPings all the DCs (Data Centers) mentioned in pyrofork (mayuri)./alive-?aliveshows basic information like memory usage and uptime./addfed- Adds the current chat into the fed list in which?fbanis to be sent./rmfed- Removes the current chat from the fed list./fban-?fban <username or id> <reason>will send/fbanwith the given reason in all the chats in fed list./ban- Either send the command by replying to a message or mentioning username.?ban <username or id>./unban- Same usage as?ban, except this command unbans the user./promote- Either send the command by replying to a message or mentioning username.?promote <username or id>./demote- Either send the command by replying to a message or mentioning username.?demote <username or id>.
/play-!play <yt or yt-music link>will start playing a song or play song replacing the current song./add-!add <yt or yt-music link>will add a song to the queue./mute- Mutes the music in voice chat./unmute- Unmutes the music in voice chat./pause- Pauses the music in voice chat./resume- Resume the music in voice chat./leave-!leavewill forcefully leave the voice chat and queue will be cleared.
Database locked : Common error faced when using the music commands.
I made this mini project to learn python as my first language. I no longer use telegram, so the purpose of this project is over.