Giter Site home page Giter Site logo

rsvpbot's Introduction

RSVPBot

Build Status

This is a simple Zulip bot that converts a Zulip conversation into an event context. People can then use simple commands to rsvp to an event, set the hour, time, place, and easily ping every person who RSVP'ed.

Contributing

  • Make your pull requests to the dev branch
  • Write tests for any new command or feature introduced
  • Make sure the requirements.txt file is kept up to date
  • Make sure any new messages that the bot sends publicly or privately follow the RC Social Rules. It takes a village, people!
  • New features are TOTALLY AWESOME, but RSVPBot has a few open issues you can take a look at if you want to get familiarized with the code or you're looking for ideas on how to contribute.
  • HAVE FUN PEOPLE YAY

Environment Variables

# Required
export ZULIP_RSVP_EMAIL="<bot-email>"
export ZULIP_RSVP_KEY="<bot-key>"

# Optional
export ZULIP_RSVP_SITE="https://your-zulip-site.com"  # default is https://recurse.zulipchat.com
export ZULIP_KEY_WORD="rsvp"                          # default is rsvp
export GOOGLE_APPLICATION_CREDENTIALS="/path/to/file" # default is None
export GOOGLE_CALENDAR_ID="[email protected]" # default is None

To get set up with Google Application Credentials, see the Google Credentials Setup Instructions.

Running

First, make sure python requirements are installed:

pip install -r requirements.txt

Then, to run the bot:

python bot.py

Updating User Email mapping

RSVPBot stores a mapping of email addresses to names, which is updated every time a realm_user event is received. Since rsvp responses are stored by email address, this mapping is used to convert the email addresses into names for commands like rsvp ping and rsvp summary. If running this bot for the first time, you can run

python zulip_users.py

which will download all users/email addresses from zulip and populate the json file dictionary. This command is safe to run multiple times.

Testing

python tests.py

Commands

Command Description
rsvp yes Marks you as attending this event.
rsvp no Marks you as not attending this event.
rsvp init Initializes a thread as an RSVPBot event. Must be used before any other command.
rsvp help Shows this handy table.
rsvp ping Pings everyone that has RSVP'd so far.
rsvp set time HH:mm Sets the time for this event (24-hour format) (optional)
rsvp set date DATE Sets the date for this event (see "date format" section for supported formats) (optional, defaults to the date the event was created with rsvp init)
rsvp set description DESCRIPTION Sets this event's description to DESCRIPTION (optional)
rsvp set place PLACE_NAME Sets the place for this event to PLACE_NAME (optional) (alias: rsvp set location)
rsvp set limit LIMIT Set the attendance limit for this event to LIMIT. Set LIMIT as 0 for infinite attendees.
rsvp cancel Cancels this event (can only be called by the caller of rsvp init)
rsvp move <destination_url> Moves this event to another stream/topic. Requires full URL for the destination (e.g.'https://zulip.com/#narrow/stream/announce/topic/All.20Hands.20Meeting') (can only be called by the caller of rsvp init)
rsvp summary Displays a summary of this event, including the description, and list of attendees.
rsvp credits Lists all the awesome people that made RSVPBot a reality.

Date format

The rsvp set date command supports US-style dates (mm/dd/yy(yy)), ISO 8601 dates (yyyy-mm-dd), and tries to understand most human dates. The following (non exhaustive) examples are all valid ways to set the date:

rsvp set date 08/29/16
rsvp set date 2016-08-29
rsvp set date today
rsvp set date tomorrow
rsvp set date in 2 days
rsvp set date tuesday next week

rsvpbot's People

Contributors

alexandrinaw avatar bgilbert avatar ifo avatar jjst avatar karamcnair avatar meereeum avatar mrdrozdov avatar munyari avatar pnasrat avatar porterjamesj avatar vakila avatar wtfcarlos avatar zeusdeux 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.