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 Events API対応 #39

Merged
merged 7 commits into from
Aug 28, 2022
Merged

Slack Events API対応 #39

merged 7 commits into from
Aug 28, 2022

Conversation

cookie-s
Copy link
Member

@cookie-s cookie-s commented Aug 26, 2022

Resolve #27

たぶん動くと思うっす

https://api.slack.com/apis/connections/events-api

config.ymlに以下を設定すると動きます:

  • slack.team_id: Tではじまるteam id。RTMと違ってEvents APIは全teamのが混ざってくるので
  • slack.use_events_api : events_apiモードにしたかったらtruthyなものを指定してね
  • slack.signing_secret: Signing Secret。

slack.use_events_api の値によって、Events APIモードにするか、旧来のRTMモードになるかが変わります。

docker-compose.ymlの内容的に、9293 portにEvents APIが来るとloggerに渡って処理される感じになっています

@cookie-s cookie-s marked this pull request as ready for review August 26, 2022 23:57
req = Rack::Request.new(env)

begin
Slack::Events::Request.new(req).verify!
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

参考: https://github.com/slack-ruby/slack-ruby-client/pull/369

Copy link
Member

@hakatashi hakatashi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

bin/init.rb Outdated Show resolved Hide resolved
docker-compose.yml Outdated Show resolved Hide resolved
logger/logger.rb Outdated Show resolved Hide resolved
@cookie-s cookie-s merged commit 58d2902 into master Aug 28, 2022
@cookie-s cookie-s deleted the slack-events-api branch August 28, 2022 15:58
@cookie-s cookie-s mentioned this pull request Aug 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RTM API をやめる
2 participants