Skip to content

Just a simple bot to send polls about lunch every friday for the upcoming week

Notifications You must be signed in to change notification settings

u451f/telegram-poll-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

What's that thing?

This is a poll bot to ask the 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

About

Just a simple bot to send polls about lunch every friday for the upcoming week

Resources

Stars

Watchers

Forks

Languages