Requirements
- Python 3.9 or higher.
- Telegram API key.
- Telegram Bot Token
- MongoDB Database.
Set Up
First of all you need to clone the repository.
git clone https://github.com/userbotindo/anjani && cd anjani
Configuration
Set up your bot configuration variables by renaming config.env_sample
to config.env
and edit it with your values.
Configuration must be done before running the bot, otherwise it will fail to run. Python 3.9 or higher is also mandatory to run the bot else it will exit.
Deploy with Docker (recommended)
Follow the official Docker Installation Guide
After all configuration file is set up, run the following command to build the bot container:
docker build . -t anjani
Run the following command to run the bot container:
docker run -d --restart unless-stopped --name anjaniBot anjani
Commands above will run the container in background and give the container name
anjaniBot
. Also if there is an error ocured during the runtime of the container, it will restart the container unless it is stopped manually.
To stop the container run the following command:
docker container stop anjaniBot
Deploy with Poetry (recommended)
Follow the official Poetry Installation Guide
Install bot dependencies:
poetry install --no-root --no-dev
If you are on Unix-like system you can add
-E uvloop
at the end of the above command to use uvloop as the event loop.
After all configuration file is set up, run the following command to run the bot:
poetry run anjani
Deploy with pip
Anjani also available on PyPI, you can install it with pip:
pip install anjani
if you are on Unix-like system you can intsall the uvloop variant with:
pip install anjani[uvloop]
The uvloop variant will use uvloop as the event loop. which is faster than the default event loop.
Install Anjani along with dependencies
You can install Anjani along with dependencies by running the following command:
python3 -m pip install .
After installation complete run the bot with the following command:
anjani