kubernetes-sigs / slack-infra

Tooling for kubernetes.slack.com
Apache License 2.0
90 stars 36 forks source link

slack-moderator-words: Add feature to join to the public channels #47

Closed cpanato closed 3 years ago

cpanato commented 3 years ago

First of all, I want to apologize for the wrong assumptions I made, and when I did the initial implementation, I added a user token for my tests, and that works out of the box :( After some investigation realize we need to add the bot in the channels, we want to moderate.

Issue:

There is no scope/event that makes the bot receive notifications for all public channels that the bot is not part of. If we want to receive events from a public channel, the bot needs to be part of the specific channel.

Options:

  1. Add the bot manually for all public channels and add that for the new channels that will be created
  2. Add some automation to make the bot self-aware of public channels

Proposed solution:

When the app/bot starts, it lists all public channels and adds itself to those channels. When a new channel is created, the bot will receive a notification and add itself to the new channel.

Possible future work:

Demo:

https://share.getcloudapp.com/jkuL7rr1

/kind feature /kind bug

/assign @nikhita @jeefy @mrbobbytables @ameukam

nikhita commented 3 years ago

I don't know much about slack code, so will defer to @jeefy

/cc @palnabarun since you've worked with the slack API before

nikhita commented 3 years ago

First of all, I want to apologize for the wrong assumptions I made, and when I did the initial implementation, I added a user token for my tests, and that works out of the box :(

and omg no need for apologies!! :heart:

jeefy commented 3 years ago

All good!

/approve

I've updated the permissions for the bot token as well. :)

k8s-ci-robot commented 3 years ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cpanato, jeefy

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/kubernetes-sigs/slack-infra/blob/master/OWNERS)~~ [jeefy] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
nikhita commented 3 years ago

/lgtm