Blog Buddy- or BB for short- is a slackbot that filters through and lists Liatrio's blogs based on specified criteria.
- Blog buddy uses SQLite as its database to store blog data and allows filtering by author, title, and summary.
- Blog buddy can also list all available blogs and suggest random blogs.
If you don't already have a Slack app for testing/development create a new one
- Goto api.slack.com/apps.
- Add an App Name like YOUR_NAME-bot.
- Select a Development Slack Workspace you want to test the bot in.
- Press the
Create App
button.
Run bot locally and expose port
- Clone project
git clone https://github.com/liatrio-apprenticeship/Blog-Buddy-Rational-Yaks.git
- Start ngrok
ngrok http 3000
- Edit .env file and add the
CLIENT_SIGNING_SECRET
,BOT_TOKEN
from the Slack app you create and setPORT
to 3000. Also addbotHostname
and set it equal to the hostname generated by ngrok, https://NGROK_HOST - Start docker containers
docker-compose up --build
Configure the follow Slack app features settings under each menu item
- Bot User: Set display name and default username and Save Changes
- OAuth & permission: Add a redirect URL which points to the ngrok forward
https://NGROK_HOST/oauth
- Event Subscriptions: Enable events, Set Request URL to ngrok forward
https://NGROK_HOST/slack/receive
and subscribe to bot events formessage.channels
,message.groups
,message.im
,message.mpim
.
Connect bot to Slack
- Goto https://NGROK_HOST/ and follow instructions to add bot to Slack.
This bot was developed in a Mac environment. If you are working in a Windows or Linux environment, you may receive docker issues when running "docker-compose up" in regards to the bot_vol/npm_scripts.sh file.
For Windows:
1. Install Notepad++
2. Import npm_scripts.sh
3. Edit -> EOL Conversion -> Unix (LF)
4. Save
For Linux:
1. Install dos2unix ( sudo apt-get install -y dos2unix )
2. Nagivate to project root directory and run "dos2unix bot_vol/npm_script.sh"