Git Product home page Git Product logo

kfcpromobot's Introduction

KFC Promo Bot

This is telegram bot to query Russian's KFC api and notify if where is a new coupons available

Disclaimer

It's mostly me doing thing for myself and for practice so don't judge or blame me if you try use it and something not working

Quick Start

Compile it for you desired target platform

Set following environment variables (it's required ones):

TGBOTTOKEN - Telegram token from @BotFather
KFCAPILINK - URL to KFC's api
MEDIALINK  - URL to KFC's media api

In it's working directory bot will create cache folder and database.db - SQLite database

Run

Docker

To build docker image root certificates required. You can obtain them using this. Those must be called ca_certs.pem and put in same folder with Dockerfile or edit Dockerfile if you so smart.

docker build -t desiredtagforimage .

Before running container create volume to store cache, database, etc. It must be mounted at /app (could be changed in Dockerfile)

docker run example:

docker run -d --name kfc_promo_bot \
    --mount source=bot_volume,target=/app \
    -e "TGBOTTOKEN=1234567890:Loremipsumdolorsitametconsecteturad" \
    -e "KFCAPILINK=https://..." \
    -e "MEDIALINK=https://..." \
    desiredtagforimage

Other environment variables

BOTDATABASEPATH - path to database default: ./database.db
CACHEPATH       - path to cache directory default: ./cache

Bot commands

/start - Start bot

/stop - Stop bot (drops all chat settings)

/promo <code> [<rest_id>] - get info on code. If rest_id provided returns info on code for specific restoraunt

/setfavrest [<rest_id>] - setting id of favorite restoraunt (id could be found somethere on kfc.ru website). If sent returns last set value

/notifications [on/off/true/false/toggle] - if sent without arguments returns current state of notifications in current channel
NOTE: /setfavrest must be set for notifactions to work

kfcpromobot's People

Contributors

toomanysugar avatar

Watchers

 avatar

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.