Skip to content

SurfyPenguin/telegram-userbot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Telegram Userbot

A multipurpose telegram userbot which can be used for moderation as well as playing music in telegram vc.

Host Locally

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
  1. Clone repository
git clone https://github.com/SurfyPenguin/telegram-userbot.git
  1. Create virutal environment
python3 -m venv .venv
  1. Activate .venv
source .venv/bin/activate
  1. Install dependencies
pip install .
  1. Run project
python3 userbot/main.py

  • Using uv
  1. Clone repository
git clone https://github.com/SurfyPenguin/telegram-userbot.git
  1. Create virtual environment
uv venv
  1. Install dependencies
uv sync
  1. Run project
uv run userbot/main.py

Project structure

telegram-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

Commands

  • Prefixes can be changed in config.py
  • ? -> Admin commands
  • ! -> Music commands

Prefix: ?

  • /purge - Send ?purge while replying to a message.
  • /info - Send ?info while replying to a message, or mentioning username ?info <username or id>.
  • /spurge - Same as ?purge except silent purge will not send number of deleted messages in chat.
  • /ping - Pings the chat in which ?ping is sent.
  • /pingdc - ?pingdc Pings all the DCs (Data Centers) mentioned in pyrofork (mayuri).
  • /alive - ?alive shows basic information like memory usage and uptime.
  • /addfed - Adds the current chat into the fed list in which ?fban is to be sent.
  • /rmfed - Removes the current chat from the fed list.
  • /fban - ?fban <username or id> <reason> will send /fban with 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>.

Prefix: !

  • /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 - !leave will forcefully leave the voice chat and queue will be cleared.

Known Issues

Database locked : Common error faced when using the music commands.

No Progress

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.

About

A multipurpose telegram userbot which can be used for moderation as well as playing music in telegram vc.

Topics

Resources

Stars

Watchers

Forks

Contributors

Languages