Browse the open issues in the main repository and pick one you want to work on. Or create one if you have found a bug or have a feature request.
Click the "Fork" button on the main page of the repository to make a copy in your own account.
Clone repositry:
git clone <forked_repositry_name>
git switch -c <your_branch_name>
- Create a new public channel.
- Add your bot to the channel and give it admin rights
- Copy .env.example and change name to .env, you can do like this:
cp .env.example .env
- Open the new file
- Edit the following environment variables in the .env file:
TELEGRAM_BOT_TOKEN
: Your bot's token. To obtain it, open the bot and follow the instructions on how to create a new bot. In the end, you will receive a token that should be set as the value for theTELEGRAM_BOT_TOKEN
environment variable.CHANNEL_USERNAME
: The channel name to which messages will be sent. If your public channel's link is https://t.me/some_name, use "some_name" as the value for CHANNEL_USERNAME.REDIS_URL
,REDIS_DB
,REDIS_POOL_SIZE
,REDIS_PREFIX_KEY
: Redis-related environment variables. Only change these if you are confident in what you are doing.BOT_LANGUAGE
: The language for the bot's interface. List of available languages is updating
Docker's installation guide you can find here.
Docker Compose installation guide you can find here
If Docker is installed and running execute the following command:
docker-compose up
Dependencies:
- python
- pip
- git
- poetry
# Install Homebrew (if not already installed)
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
# Install git and python
brew install git python
# Install Poetry
pip install poetry
- Ubuntu
sudo apt update
sudo apt install git python3 python3-pip python3-poetry
- Arch
sudo pacman -Syu git python python-pip python-poetry
- Python: Download the installer from the official Python website and follow the installation steps.
- Git: Download the installer from the official Git website and follow the installation steps.
- Poetry: Open a Command Prompt or PowerShell window and run the following command to install Poetry:
pip install poetry
You can check if everything installed by this command:
poetry -v && git -v && pip -v && python --version
Create a virtual environment with poetry For more information visit this website
You can run do it like this in terminal:
poetry install && poetry shell
If you're using PyCharm or Visual Studio Code with the Python extension, it should use the virtual environment created by Poetry by default.
If you want to use redis on your local dev set-up set
REDIS_URL=localhost
in the .env file.
Make the necessary changes in the code or documentation.
Make sure that the changes you've made work locally before creating a Pull Request
❕ IMPORTANT. Make sure to refactor your code using "Black" formatter before creating a Pull Request
To install Black formatter run:
pip install black
To format your code run:
black .
Add your changes through Git and create a commit with a descriptive message.
git add .
Create a Commit
git commit -m 'Your descriptive message'
NOTE: Each pull request (PR) should contain only one commit. If you have multiple commits, they need to be squashed.
When your work is ready and complies with project conventions, upload your changes to your fork:
# Push your work to your remote repository
git push -u origin <your_branch_name>
Go to the page of your fork on GitHub and click "New Pull Request". Verify that the changes are displayed correctly, and then submit your pull request.