Skip to content

AndrewDarnall/Universal-Converter-Bot

Repository files navigation

Anything to PDF Converter Bot

Version Build Status


Requirements

Software Version
Python 3.12.2
pip 23.3.1
Docker 20.10.5
LibreOffice 7.0.4.2

The bot is a very simple tool made to aid a simple and hassle-free conversion of any type of libreoffice supported document into a .pdf file (without having to go through a sketchy website)


Testing the bot

My bot is currently deployed on my remote server, you can try it if you'd like


Running the bot locally

In order to run the bot functionality locally, simply follow the steps listed below


Setup & Configuration

To run the same Telegram bot for youreself, you need to create a Telegram Account and then register an app as a Telegram Developer following this guide
After completing the previous tasks you will endup with an API_ID and API_HASH which are tied to your personal telegram account

Finally register a new Telegram Bot via the Bot Father, after which you will obtain the BOT_TOKEN

Installation & Usage

  1. Clone the git repository and change into the repository's directory
git clone https://github.com/AndrewDarnall/Universal-Converter-Bot.git
cd Universal-Converter-Bot
  1. Populate the variables within the ./scripts/envs_setup.sh script with your personal API_ID, API_HASH and BOT_TOKEN values, and run the following script
bash ./scripts/envs_setup.sh "your_API_ID" "your_API_HASH" "your_BOT_TOKEN"
  1. Build the docker container from the Dockerfile
docker build -t converter-bot-py .
  1. Run the docker container, which will in turn run the Telegram Bot and accept messages sent to it
docker run -d -e API_ID=$API_ID -e API_HASH=$API_HASH -e BOT_TOKEN=$BOT_TOKEN --name converter_bot_py converter-bot-py
  1. Open a Telegram Client of choice and begin a chat with your telegram bot, after which you will be able to send any document you wich, as long as it is smaller than 2GB and it will return a converted file into .pdf format, as long as libreoffice supports said conversion