Skip to content

About

orders bbt for the team

Resources

Stars

0 stars

Watchers

1 watching

Forks

Repository files navigation

Chatime Bot - Slack Bubble Tea Ordering Bot

A Slack bot that makes ordering bubble tea (Chatime) easy and fun for teams. Order your favorite drinks through interactive dialogs without leaving Slack.

Bubble Tea

Features

  • Interactive Drink Ordering - Add drinks through beautiful Slack dialogs
  • Customization Options - Choose drink type, toppings, ice level, sugar level, size, and temperature
  • Hot & Cold Drinks - Full menu support for both hot and cold beverages
  • Group Orders - Track orders across your entire team
  • Individual Order Management - View, modify, or reset your own orders
  • Order Summaries - See consolidated orders or peek at what everyone ordered
  • Reminders - Ping team members who haven't ordered yet

Quick Start

Prerequisites

  • Python 3.x
  • A Slack workspace with admin permissions
  • Slack App credentials (see Setup below)

Installation

  1. Clone the repository:
git clone https://github.com/yourusername/chatime-bot.git
cd chatime-bot
  1. Install dependencies:
pip install -r requirements.txt
  1. Create your environment file:
cp .env.example .env
  1. Run the bot:
python app.py

Setup

Creating a Slack App

  1. Go to api.slack.com/apps and create a new app
  2. Add the following Bot Token Scopes:
    • chat:write - Send messages
    • im:write - Open direct messages
    • channels:history - Read channel history
    • groups:history - Read group history
    • im:history - Read DM history
    • mpim:history - Read multi-person DM history
  3. Add the following Event Subscriptions:
    • message.channels - Messages in channels
  4. Enable Interactive Components
  5. Install the app to your workspace and copy the credentials

Environment Variables

Add the following to your .env file:

CLIENT_ID=your_client_id
CLIENT_SECRET=your_client_secret
VERIFICATION_TOKEN=your_verification_token
OAUTH_ACCESS_TOKEN=your_oauth_access_token
BOT_OAUTH_ACCESS_TOKEN=your_bot_oauth_access_token

Usage

Commands

Interact with the bot by mentioning it with commands in any channel or DM:

Command Description
@bbbot add Open dialog to add a drink to your order
@bbbot remove Open dialog to remove a drink from your order
@bbbot my_order View your current drinks
@bbbot order View the final collective order summary
@bbbot reset Reset the entire order (for admins)
@bbbot reset_me Reset only your own order
@bbbot peek View what everyone ordered
@bbbot yell Ping people who haven't submitted their order
@bbbot help Show all available commands

Ordering a Drink

  1. Type @bbbot add in any channel
  2. The bot will open a DM with you
  3. Choose "Hot Drink" or "Cold Drink"
  4. Select your drink from the menu (organized by category)
  5. Choose toppings, ice level, sugar level, and size
  6. Submit your order!

Deployment

Using PM2

The project includes a PM2 configuration file:

pm2 start chatime-bot.pm2.config.json

Using Docker (Optional)

Create a Dockerfile:

FROM python:3.9-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . .
CMD ["python", "app.py"]
EXPOSE 5000

Customizing the Menu

Edit the JSON files in drink_data_files/:

  • drinks.json - Add or modify drink options
  • toppings.json - Available toppings
  • ice.json - Ice level options
  • sugar.json - Sugar level options
  • size.json - Size options

Development

Running Tests

pytest

Project Structure

chatime-bot/
├── app.py              # Flask app and Slack event routing
├── bot.py              # Main Bot class
├── drink.py            # Drink and DrinkMenu classes
├── order.py            # DrinkOrder class
├── user.py             # User class
├── drink_data_files/   # Menu data (JSON)
├── templates/          # HTML templates for install page
├── tests/              # Test files
├── requirements.txt    # Python dependencies
└── .env.example        # Environment variables template

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT License - see LICENSE file for details

Acknowledgments

Built with:

About

orders bbt for the team

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages