Coder Social home page Coder Social logo

baco23 / food-waste-bot Goto Github PK

View Code? Open in Web Editor NEW

This project forked from liuhh02/food-waste-bot

0.0 0.0 0.0 19 KB

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

License: MIT License

Python 100.00%

food-waste-bot's Introduction

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.