This is an accelerator pack for deploying a telegram bot which uses Jugalbandi APIs.
- After creating a telegram bot using BotFather in Telegram, copy the token of the newly created bot and replace it with this text TELEGRAM_BOT_TOKEN_KEY in telegram_bot.py
- Replace the text UUID_NUMBER with the uuid number of your document set to be queried in telegram_bot.py
- Currently the bot has configurations for 3 languages (English, Hindi, Kannada). The same can be updated for other Indian languages as well in the respective places.
- The bot commands (start, set_language) can be customized by using BotFather in Telegram. In order to do that, go to BotFather and choose the bot to edit its command and paste the follow lines.
start - Start the bot
set_language - To choose language of your choice
- Install the necessary python packages for this bot by running this command
pip install -r requirements.txt
- [OPTIONAL] Edit the url in get_query_response function in telegram.py to use other endpoints of your choice.
- For running the bot in the local environment, run this command
python3 telegram_bot.py
and open the bot in Telegram to start querying. - [OPTIONAL] For deploying the bot as a service in cloud (eg: Compute Engine in GCP), bot.service file can be used as a template file.