Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README #4

Open
wants to merge 2 commits into
base: kate
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
138 changes: 110 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,82 @@
# uniborg
# uniborg - Pluggable Telegram Userbot Based on Telethon

Pluggable [``asyncio``](https://docs.python.org/3/library/asyncio.html)
[Telegram](https://telegram.org) userbot based on
[Telethon](https://github.com/LonamiWebs/Telethon).
## Overview

## installing
**uniborg** is a modular [Telegram](https://telegram.org) userbot built on the [Telethon](https://github.com/LonamiWebs/Telethon) framework. Its design allows users to enhance their Telegram experience through a variety of plugins that can be enabled or disabled as needed.

Simply clone the repository and run the main file:
```sh
git clone https://github.com/udf/uniborg.git
cd uniborg
python stdborg.py
```
## Features

- **Modular Design**: Easily add or remove plugins to customize functionality.
- **Asynchronous Operation**: Built with Python's [``asyncio``](https://docs.python.org/3/library/asyncio.html) for efficient performance.
- **Event Handling**: Utilizes Telethon's event system to respond to various Telegram events.
- **Simple Variables**: Each plugin gets the `borg`, `logger` and `storage`
[variables](https://github.com/udf/uniborg/blob/4805f2f6de7d734c341bb978318f44323ad525f1/uniborg/uniborg.py#L66-L68)
to ease their use.

The core features offered by the custom `TelegramClient` live under the
[`uniborg/`](https://github.com/udf/uniborg/tree/master/uniborg)
directory, with some utilities, enhancements and the core plugin.

## design
## Installation

The modular design of the project enhances your Telegram experience
through [plugins](https://github.com/udf/uniborg/tree/master/stdplugins)
which you can enable or disable on demand.
### Prerequisites

Each plugin gets the `borg`, `logger` and `storage` magical
[variables](https://github.com/udf/uniborg/blob/4805f2f6de7d734c341bb978318f44323ad525f1/uniborg/uniborg.py#L66-L68)
to ease their use. Thus creating a plugin as easy as adding
a new file under the plugin directory to do the job:
Before installing, ensure you have:

- [Python 3.8+](https://www.python.org/downloads/)
- [Git](https://git-scm.com/)
- A [Telegram API key](https://my.telegram.org/apps)

### Setup Steps

1. **Clone the Repository**:

```sh
git clone https://github.com/udf/uniborg.git
```

2. **Navigate to the Project Directory**:

```sh
cd uniborg
```

3. **Switch to the **kate** Branch**:

```sh
git checkout kate
```

4. **Install Dependencies**:

```sh
pip install -r requirements.txt
```

5. **Configure the Userbot**:

- Rename `api_key.example.py` to `api_key.py`.
- Edit `api_key.py` to include your Telegram API credentials:
```python
api_id = 'YOUR_API_ID'
api_hash = 'YOUR_API_HASH'
```

6. **Run the Userbot**:

```sh
python stdborg.py
```

## Plugin Development

### Creating a New Plugin

1. **Create a New Plugin File**:

Add a new Python file in the `stdplugins` directory. For example, `stdplugins/myplugin.py`.

2. **Define Event Handlers**:

```python
# stdplugins/myplugin.py
@@ -33,15 +87,43 @@ async def handler(event):
await event.reply('hey')
```

## internals
In this snippet, the bot listens for messages containing 'hi' and responds with 'hey'.

Check out the
[plugins](https://github.com/udf/uniborg/tree/master/stdplugins)
directory to learn how to write your own, and consider reading
[Telethon's documentation](http://telethon.readthedocs.io/)
for further information.

The core features offered by the custom `TelegramClient` live under the
[`uniborg/`](https://github.com/udf/uniborg/tree/master/uniborg)
directory, with some utilities, enhancements and the core plugin.
## Contributing

### How to Contribute

1. **Fork the Repository**.
2. **Create a New Branch**:
```sh
git checkout -b feature-branch
```
3. **Commit Your Changes**:
```sh
git commit -m "Added new feature"
```
4. **Push to Your Fork**:
```sh
git push origin feature-branch
```
5. **Submit a Pull Request**.

## License

This project is licensed under the [Mozilla Public License 2.0](LICENSE).

## Acknowledgements

- [Telethon](https://github.com/LonamiWebs/Telethon) - The Python Telegram client library powering uniborg.

---

📌 *Note: This README is tailored for the **`kate`** branch of the UniBorg project. Ensure you're on the correct branch when following these instructions.*

## learning

Check out the already-mentioned
[plugins](https://github.com/udf/uniborg/tree/master/stdplugins)
directory to learn how to write your own, and consider reading
[Telethon's documentation](http://telethon.readthedocs.io/).