Skip to content

Telegram bot built using python-telegram-bot that links people with leftovers to those who need the food

License

Notifications You must be signed in to change notification settings

liuhh02/food-waste-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

food-waste-bot

Telegram bot built using python-telegram-bot that links people with leftovers to those who need the food

See the full article explaining this project here and how it was deployed in heroku here. alt text

Getting Started

  1. Create a Telegram bot using the command /newbot with BotFather. Get the API key of your bot. alt text
  2. Create a Telegram channel.
  3. Download the three files in this repo: bot.py (containing your python code for the Telegram bot), requirements.txt (containing the python libraries to be installed), and Procfile (containing the command to execute the python file).
  4. Modify the line in the bot.py file 'TOKEN = 'YOURTELEGRAMBOTTOKEN' to the API key of your bot, and the chat_id = 'YOURTELEGRAMCHANNEL' to the link of your Telegram channel.
  5. Set up the Google Maps API:
  6. Go to the Google Cloud Platform console
  7. Search for API & Services in the search bar.
  8. Click on the blue plus button saying ENABLE APIS AND SERVICES right below the search bar.
  9. Search for Geocoding API and enable it.
  10. Under API & Services, go to Credentials and select CREATE CREDENTIALS > API key.
  11. Modify the line in the bot.py file GMAPSAPI = 'YOURGOOGLEMAPSAPITOKEN' to your Google Maps API.
  12. Follow the steps here to set up an account and an app on Heroku.
  13. You're done! Send /start to your bot and it should respond with the following message:

Hi! I am your posting assistant to help you advertise your leftover food to reduce food waste. To start, please type the location of the leftover food.

My Implementation

You can find the bot I created at @foodrescuerbot and Telegram channel at https://t.me/foodrescuers.

About

Telegram bot built using python-telegram-bot that links people with leftovers to those who need the food

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages