A SlackBot which collects team message and analyze team contribution.
489
A SlackBot which collects team message and analyze team contribution.
Public IP(for SlackAPI communication). Alternatively you can use Ngrok to get a public URLs for testing in your own machine.(see Detail session below)OAuth Access Token & Bot User OAuth Access Token :
channels:, chat:, groups: and im: permission in order to collect and send message from bot.xoxp-xxxxxx....xoxb-xxxxxx....App Verification Token
xxxxxxxxxx...Slash Commands API Setup:
/setteam, Request URL http://[Your Domain name or IP]:8080/setTeam, and proper short description (e.g. "Assign you in this channel as team")./setdeadline, Request URL http://[Your Domain name or IP]:8080/setDeadline, with proper short description (e.g. "Set Project Deadline (Admin Only)") and Usage Hint "[1] [2019/4/1]"./teamstatistic, Request URL http://[Your Domain name or IP]:8080/getTeamStatisticData, and proper short description (e.g. "See how's your team doing this time")./mystatistic, Request URL http://[Your Domain name or IP]:8080/getMyStatisticData, and proper short description (e.g. "See how's you doing this time")./teamstatisticdetail, Request URL http://[Your Domain name or IP]:8080/getTeamStatisticDataDetail, and proper short description (e.g. "See your team statistic data in detail")./mystatisticdetail, Request URL http://[Your Domain name or IP]:8080/getMyStatisticDataDetail, and proper short description (e.g. "See my statistic data in detail").Start The services (MongoDB and SlackBot)
.env file. Decide your own DBAdminUsername and DBAdminPassword, the MongoDB service will create the account for you.DBAdminUsername=[Your MongoDB Username]
DBAdminPassword=[Your MongoDB Password]
OauthToken=[OAuth Access Token]
OauthBotToken=[Bot User OAuth Access Token]
VerficationToken=[App Verification Token]
mongoDBURL=mongodb://[Your MongoDB Username]:[Your MongoDB Password]@mongo:27017/admin
/etc/localtime. You can use data -R to check if timezone is correct right now$ tzselect
$ cp /usr/share/zoneinfo/America/Chicago /etc/localtime
$ date -R
docker-compose$ docker-compose up -d
NOTE: The MonogoDB database will save in /data in your host machine. You can clean the database by remove /data folder and restart the services.
NOTE: Slack bot serves on port 8080 by default
Close the services (MongoDB and SlackBot)
docker-compose$ docker-compose down
docker-compose will maintain MonogoDB and SlackBot service if crash, and all the data in MongoDB will remain when services restart.Update the services
docker-compose$ docker-compose down
docker$ docker pull henry2423/tabot
docker-compose$ docker-compose up -d
Crawl All Channels Message in Workspace: The bot will crawl all your Public Channels and Private Channel (if you invited the bot in) and its messages to MongoDB in the first time. And the crawl action will do every 5 minutes.
Crawl User Lists in Workspace: The bot will crawl the information of all user in the worksapce in the first time. And update user info every 5 minutes.
Crawl Channel Lists in Workspace: The bot will crawl the information of all channels (private and public) in the worksapce in the first time. And update every 5 minutes.
Slash Command:
/setteam: This command is for student to assign themself into their private group channel, which is essential for bot to know which team they belongs to. NOTE: Don't forget to add the bot into students' private group channel/setdeadline [projectIndex] [Date]: This command is used to setup deadline for every projects, it is only available for Administrator in worksapce. Please follow the specific format to setup the deadline (e.g. /setdeadline 1 2019/4/1)./teamstatistic: View student's team statistic matrix this project compare to previous/teamstatisticdetail: View student's team statistic matrix across projects/mystatistic: View student's statistic matrix within their team this project compare to previous/mystatisticdetail: View student's statistic within their team matrix across projectsInteractive Component:
Smart Reminder: When Slack User A in chnnel ask some question and tag User B to answer it. But User B didn't reply to that message in channel after 3 days. Bot will send a notification message to User B Direct Channel to reply message.Ngrok Setup:
$ ./ngrok http 8080
https://bxxxxx.ngrok.io can be used for Slack APP now.

Slash Commands API Setup and Interactive Component Setup in Setup Requirement session, your URL will be https://bxxxxx.ngrok.io/getStatistic and https://bxxxxx.ngrok.io/action with port specified.Build the image from scratch:
docker-compose.yamltabot:
build:
context: .
dockerfile: Dockerfile
depends_on:
- mongo
links:
- mongo
image: henry2423/tabot
restart: always
ports:
- 8080:8080
environment:
OauthToken: ${OauthToken}
OauthBotToken: ${OauthBotToken}
VerficationToken: ${VerficationToken}
mongoDBURL: ${mongoDBURL}
Content type
Image
Digest
Size
617.5 MB
Last updated
almost 7 years ago
docker pull henry2423/tabot