Git Product home page Git Product logo

telegram-poll-bot's Introduction

What's that thing?

This is a poll bot to ask my office peers who cooks and who wants to eat lunch. Super precise, but maybe you can adapt it to your needs. Also… it talks German :)

Usage

chmod +x pollbot.py

Set up the bot

On Telegram:

  • talk to @BotFather and create a new bot
  • copy token and add to .dotenv (requires python3-dotenv package) → or actually add that to Github secrets (settings → secrets and variables → actions → Repository secrets) - this is what we work with (we need TOKEN and CHAT_ID)
  • test if token works: https://api.telegram.org/botTOKEN/getMe (replace TOKEN) by actual token

Add bot to the group or channel where it shall post the polls

  • add bot to relevant group chat
  • talk to @RawDataBot and find out the chat id of the group

Documentation of poll API

Launching the script

This script needs to be launched every Friday the week before. This can be done by a cronjob or by a Github workflow (see .github/workflows for code). We are currently using the Github workflow.

Specifics

The closing_date will always be automatically 8 days from the creation of the poll.

Check for broken requirements

python -m pip check

telegram-poll-bot's People

Contributors

u451f 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.