Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slack Bot #192

Open
eshnil opened this issue Aug 25, 2020 · 1 comment
Open

Slack Bot #192

eshnil opened this issue Aug 25, 2020 · 1 comment

Comments

@eshnil
Copy link
Collaborator

@eshnil eshnil commented Aug 25, 2020

In last few commits, I have implemented a basic Slack bot functionality. This is how it works:

image

  • This slack app needs the following Oauth permission scopes: chat:write, chat:write.public, commands

image

  • Once the permission is granted, the access token is stored in SlackAuthorization table.

  • 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 in SlackSubscription table 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 SlackNotifyJob which is used only in our own slack to post items from ALL topics to the #new-items channel. BTW, we also post a random topic to our #general channel in SocialMediaUpdatesJob every day at 13:00 UTC.

image

Enhancement ideas

  • Post daily updates to slack subscriptions so that they don't have to wait till a new item gets added
  • Enable conversations and on-demand resources
@eshnil
Copy link
Collaborator Author

@eshnil eshnil commented Aug 28, 2020

I've implemented DailySlackAlertJob. Keeping it open for future ideas about conversations and more bot features.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.