Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upSlack Bot #192
Slack Bot #192
Comments
|
I've implemented |
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign up|
I've implemented |
In last few commits, I have implemented a basic Slack bot functionality. This is how it works:
chat:write,chat:write.public,commandsOnce the permission is granted, the access token is stored in
SlackAuthorizationtable.This bot currently adds two slash commands:
/startlearning [topic]and/stoplearning [topic]. Using these commands, slack teams' channels can subscribe/unsubscribe to topics. These subscriptions are kept inSlackSubscriptiontable which has a schema(slack_authorization_id, channel_id, topic_id)Whenever a new item is created, all such channels are notified by
SlackSubscriptionNotifyJob.This is different from
SlackNotifyJobwhich is used only in our own slack to post items from ALL topics to the#new-itemschannel. BTW, we also post a random topic to our#generalchannel inSocialMediaUpdatesJobevery day at 13:00 UTC.Enhancement ideas