itsrainingmani / bogo-bot

Zulip Bot for pairing Recursers wanting BOGO Lunch deals

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RC UberEats BOGO Bot

There are many UberEats Buy One Get One deals available around 397 Bridge St. This is a Zulip bot that will pair lunchers so people can take advantage of the BOGO Deals.

This project is directly inspired by the experience of Recursers at the Brooklyn Hub & by the RC Eats project created by Angelo Lloti (W2'24)

Create Zulip Bot

Add a bot to Zulip by following the instructions here - https://zulip.com/help/add-a-bot-or-integration#add-a-bot-or-integration_1

Please make sure that the type of your bot is Outgoing Webhook since the bot will be receiving new messages via HTTP POST requests from Zulip.

name: whatever
email: whatever
bot type: outgoing webhook
endpoint URL: $DOMAIN/webhooks, e.g. `<YOUR-DOMAIN-HERE>.ngrok-free.app/webhooks`

> interface: generic

Install Python Requirements

⚠️ This project uses python 3.12.0. Other python versions are not guaranteed to work.

Install the necessary requirements with -

pip install -r requirements.txt

Set up ngrok

We are using ngrok to serve our localhost server publically. You can use any option (eg. Tailscale Funnel, localtunnel) that allows you to serve localhost to a static publicly available URL.

Make an account and get a static URL here

Example (use your static URL instead):

brew install ngrok/ngrok/ngrok
ngrok config add-authtoken <TOKEN>

Serve Local Web Server

DOMAIN=<YOUR-DOMAIN-HERE>.ngrok-free.app
PORT=8000
ngrok http --domain=$DOMAIN $PORT

Run Flask Server

flask --app server run --port 8000

If you'd like to hot-reload your server on code changes, add the --debug flag to the above command.

DM the bot you created to test

The currently supported commands are -

* `show deals`: to display available BOGO deals
* `status`: to show your subscription status
* `subscribe`: to start getting matched with other BOGOBot users for pair lunching
* `unsubscribe`: to stop getting matched

About

Zulip Bot for pairing Recursers wanting BOGO Lunch deals

License:MIT License


Languages

Language:Python 97.5%Language:Dockerfile 1.7%Language:Shell 0.8%