LunchBuddy is a Slack bot designed to simplify your lunch planning. It fetches daily menu offers from nearby restaurants and displays them directly in your Slack workspace. With features like restaurant-specific menu queries, lunch polls, and seamless Slack integration, LunchBuddy is the ultimate tool for teams deciding where to eat.
Triggers a simple poll with the question "Where should we go for lunch?"
Displays a list of all restaurants along with their daily menus.
git clone https://github.com/be-lenka/lunchbuddy.git && cd lunchbuddy
- Go to the Slack API Apps page.
- Click "Create New App".
- Choose "From scratch" and provide a name for your app (e.g.,
LunchBuddy
) and select your Slack workspace. - Navigate to "OAuth & Permissions":
- Add the following scopes under Bot Token Scopes:
chat:write
commands
reactions:write
channels:read
groups:read
im:read
mpim:read
- Click "Install App to Workspace" and authorize the app.
- Copy the Bot User OAuth Token.
- Add the following scopes under Bot Token Scopes:
- Navigate to "Basic Information":
- Copy the Signing Secret.
- Navigate to "Socket Mode":
- Enable Socket Mode and generate an App Token.
- Copy the App Token.
- Create a
.env
file in the root directory:touch .env
- Add the following environment variables to the
.env
file:SLACK_BOT_OAUTH_TOKEN=your-bot-user-oauth-token SLACK_SIGNING_SECRET=your-signing-secret SLACK_API_TOKEN=your-app-token SLACK_DEBUG=true PORT=3000
npm install
To run the bot in the background, use PM2, a process manager for Node.js applications.
Install PM2 globally on your system:
npm install -g pm2
Start the bot using PM2:
pm2 start src/index.js --name lunchbuddy
Save the PM2 process list to ensure it restarts automatically after a system reboot:
pm2 save
Generate and configure a startup script for PM2 to run on system boot:
pm2 startup
- View logs:
pm2 logs lunchbuddy
- Check the status of the bot:
pm2 status
- To stop the bot:
pm2 stop lunchbuddy
- To restart the bot:
pm2 restart lunchbuddy
Invite the bot to a Slack channel by typing:
@<your-bot-name>
Or start a direct message with the bot.
npm test