ilham-mmr / PKOBHelper-python-telegram-bot

The repo contains an assignment of telegram bot for real-time programming STIW3054

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PYTHON TELEGRAM BOT PROJECT

Read the instruction

Your Info

Name Matric No
Rachmat Ilham Muslim Maulana 268954

Introduction

The Pusat Kawalan Operasi Bencana (PKOB) is a centralized mechanism that allows a district's penghulu to join disaster relief efforts right away. This method not only helps victims right away, but it also saves money by not wasting resources. The data are centralized, so the chief of village can respond faster and track down records. Furthermore, victims can apply for assistance online, saving time and effort over the traditional method.

The telegram bot helps victims get their assistance status info by keying in their required information such as ic and phone number.

Deployment Guide

  1. create an app on heroku
  2. create config.py that consists of this code
    PORT = int(os.environ.get('PORT',5000))
    TOKEN = os.environ.get('TOKEN')
    
  3. change this code updater.start_polling() to
     updater.start_webhook(listen="0.0.0.0",
                             port=int(PORT),
                             url_path=TOKEN, webhook_url="https://pkob268954bot.herokuapp.com/" + TOKEN)
    
  4. because we get PORT and TOKEN from environment. we need to add it in heroku by going to settings then Config Vars.
  5. do pip freeze > requirements.txt
  6. add Procfile
    web: python3 bot.py
    
  7. then git push heroku main
  8. if there is still an error, do
    heroku ps:scale web=1
    

Result/Output (Screenshot of the output)

START

1

GET VICTIM INFO (SUCCESS)

2

GET VICTIM INFO (FAILED)

3

WEBSITE

3

HELP

3

ABOUT

3 3 3

Youtube Presentation

https://youtu.be/caSUQDTWauU

List of Python packages (including the version) used for this system

The main python packages used are :

  • python-telegram-bot | the telegram bot library
  • requests | to do https verbs
  • requirements.txt

References (Not less than 10)

About

The repo contains an assignment of telegram bot for real-time programming STIW3054


Languages

Language:Python 100.0%