Skip to content

RusKursusGruppen/robo-flach

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Robo-Flach

The helper for our lunch club.

The club works by one person writing "anybody up for lunch?" in a messenger thread, the people that want to join then reacts to the message with a 👍 emoji.

Set-up

Run the following set of commands to get a local development environment

$ pip3 install virtualenv
$ virtualenv -p `which python3` virtualenv
$ source virtualenv/bin/activate
$ pip install -r requirements.txt
$ pip install git+https://github.com/carpedm20/fbchat.git@refs/pull/371/head

You also need two credential files, one must be located at src/config.ini and it must contain the following.

[FACEBOOK]
email = <email>
password = <password>
thread_id = <Thread_id>

The other credential file is for the google sheet, follow the setup guide to obtain the file.

Dependencies

The two main dependencies are FBchat which is the library used for interaction with messenger, and Gspread that interacts with Google Sheets.

Code Structure

The code is split into two parts, one part the does the balance sheet and keeps tracks of lunches. The other part is a chatbot that does fun/annoying things.

  • src/FbBot.py and googleBot.py These files wrap around the apis for messenger and sheets. They are used for the balance sheet part of the code.
  • src/main.py This files combines the two above parts to get the lunch balance, the file is made to be run about once per week with no state. Only place code that is Idempotent
  • src/chatBot.py This is the fun part of the code, here the bot actually writes in the chat, this file extends the class described here. The code is event driven so look at the functions of the form onEventHappend for instance onMessage. Additional Inspiration can be found here

TODO

  • Write message about lunch on every weekday
  • Welcome new members and add them to sheet
  • Put in production
  • Improve message detection
  • Add jokes and shit to chatbot
  • Any ideas?

Done

  • Write function that gets all names
  • Write function that gets all lunches
  • Function that creates a the table of lunhces
  • Environment setup

About

Bot der hjælper med frokostklubben

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages