learn-awesome/learn

Slack Bot

Open

#192 geöffnet am 25. Aug. 2020

Auf GitHub ansehen
 (4 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)HTML (46 Forks)batch import
Hacktoberfestgood first issue

Repository-Metriken

Stars
 (338 Stars)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

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

Contributor Guide