This is a (not) powerful Telegram userbot built using the Pyrogram framework. Automatization, Management, Fun.
Before you can run userbot, ensure that you have the following:
- Python 3.7+ installed
- API ID and API Hash
Clone the repository:
git clone https://github.com/hkamori/kaleidoscope.git
cd kaleidoscopeCreate a virtual environment (optional but recommended):
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
Install the required dependencies:
pip install -r requirements.txtRun:
python main.pyPing: (ping | pong | alive | check)
Info: (info | kaleidoscope | userbot | about)
Help: (help | commands)
Settings: (settings | setvalue)
Stop: (stop | exit)
Restart: (restart | reboot)
SetPrefix: (setprefix)
ExecLine: (exec)
Translate: (tr)
ILoveYou: (ily)
Weather: (weather)
-
Create a new
.pyfile in the modules folder. For example, name itmodulename.py. -
Add the necessary imports to your module file. For example, if you need a timer function, you would add:
import time- Add commands list:
commands = ['command', 'command2'] #add more if needed- Define the main function of your module:
async def handle(app: Client, client: Client, message, args):- Write your code inside this function. For example, if you want to send a message using Pyrogram, use the following:
await app.send_message(message.chat.id, "Your message here")- Working with Pyrogram: To create useful modules, it's important to know how to work with Pyrogram’s methods. Refer to the Pyrogram documentation if needed.
If your module requires reading or writing to a configuration file, import the configuration functions like this:
from utils import configYou can then use the following functions:
config.add_to_config(key, value)– Add or update a key-value pair.config.read_from_config(key)– Read a specific key from the config.config.read_all_keys()– Get all configuration keys.remove_from_config(key)– Remove key-value pair.
- Testing: Once you’ve added the command, test your module by running the bot and executing the command in a chat.
- Expanding: You can continue adding more functionality to your module as needed by using Pyrogram’s extensive methods and utilities. By following these steps, you will be able to create and integrate custom modules into your userbot.
Feel free to fork the repository, submit issues, or contribute new features via pull requests.
- Fork the repository.
- Create a new branch
(git checkout -b feature-branch). - Make your changes.
- Commit the changes
(git commit -m 'Add new feature'). - Push to the branch
(git push origin feature-branch). - Open a pull request.