A Slack bot that makes ordering bubble tea (Chatime) easy and fun for teams. Order your favorite drinks through interactive dialogs without leaving Slack.
- 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
- Python 3.x
- A Slack workspace with admin permissions
- Slack App credentials (see Setup below)
- Clone the repository:
git clone https://github.com/yourusername/chatime-bot.git
cd chatime-bot- Install dependencies:
pip install -r requirements.txt- Create your environment file:
cp .env.example .env- Run the bot:
python app.py- Go to api.slack.com/apps and create a new app
- Add the following Bot Token Scopes:
chat:write- Send messagesim:write- Open direct messageschannels:history- Read channel historygroups:history- Read group historyim:history- Read DM historympim:history- Read multi-person DM history
- Add the following Event Subscriptions:
message.channels- Messages in channels
- Enable Interactive Components
- Install the app to your workspace and copy the credentials
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
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 |
- Type
@bbbot addin any channel - The bot will open a DM with you
- Choose "Hot Drink" or "Cold Drink"
- Select your drink from the menu (organized by category)
- Choose toppings, ice level, sugar level, and size
- Submit your order!
The project includes a PM2 configuration file:
pm2 start chatime-bot.pm2.config.jsonCreate a Dockerfile:
FROM python:3.9-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . .
CMD ["python", "app.py"]
EXPOSE 5000Edit the JSON files in drink_data_files/:
drinks.json- Add or modify drink optionstoppings.json- Available toppingsice.json- Ice level optionssugar.json- Sugar level optionssize.json- Size options
pytestchatime-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
Contributions are welcome! Please feel free to submit a Pull Request.
MIT License - see LICENSE file for details
Built with:
