質問編集履歴
5
情報の追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -35,6 +35,8 @@
|
|
35
35
|
###ソースなど
|
36
36
|
|
37
37
|
コントローラーはこちらの記事を参考に記述。
|
38
|
+
|
39
|
+
[オウム返し slack bot をぱっとつくる](https://qiita.com/takose/items/bc2b63426b9921604599)
|
38
40
|
|
39
41
|
|
40
42
|
|
4
修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -46,9 +46,13 @@
|
|
46
46
|
|
47
47
|
class MemberJoinedChannelController < ApplicationController
|
48
48
|
|
49
|
+
|
50
|
+
|
51
|
+
protect_from_forgery :except => [:create]
|
52
|
+
|
53
|
+
|
54
|
+
|
49
55
|
def create
|
50
|
-
|
51
|
-
debugger
|
52
56
|
|
53
57
|
@body = JSON.parse(request.body.read)
|
54
58
|
|
3
修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -43,6 +43,8 @@
|
|
43
43
|
#受け取りたいコントローラー
|
44
44
|
|
45
45
|
|
46
|
+
|
47
|
+
class MemberJoinedChannelController < ApplicationController
|
46
48
|
|
47
49
|
def create
|
48
50
|
|
2
追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -34,6 +34,8 @@
|
|
34
34
|
|
35
35
|
###ソースなど
|
36
36
|
|
37
|
+
コントローラーはこちらの記事を参考に記述。
|
38
|
+
|
37
39
|
|
38
40
|
|
39
41
|
```
|
@@ -42,13 +44,23 @@
|
|
42
44
|
|
43
45
|
|
44
46
|
|
45
|
-
class MemberJoinedChannelController < ApplicationController
|
46
|
-
|
47
|
-
|
48
|
-
|
49
47
|
def create
|
50
48
|
|
49
|
+
debugger
|
50
|
+
|
51
|
-
|
51
|
+
@body = JSON.parse(request.body.read)
|
52
|
+
|
53
|
+
case @body['type']
|
54
|
+
|
55
|
+
when 'url_verification'
|
56
|
+
|
57
|
+
render json: @body
|
58
|
+
|
59
|
+
when 'event_callback'
|
60
|
+
|
61
|
+
# ..
|
62
|
+
|
63
|
+
end
|
52
64
|
|
53
65
|
end
|
54
66
|
|
@@ -102,4 +114,24 @@
|
|
102
114
|
|
103
115
|
|
104
116
|
|
117
|
+
```
|
118
|
+
|
119
|
+
#URL入力後のログ
|
120
|
+
|
121
|
+
Started POST "/member_joined_channel" for 54.224.250.46 at 2019-09-30 17:52:44 +0900
|
122
|
+
|
123
|
+
Cannot render console from 54.224.250.46! Allowed networks: 127.0.0.1, ::1, 127.0.0.0/127.255.255.255
|
124
|
+
|
125
|
+
Processing by MemberJoinedChannelController#create as */*
|
126
|
+
|
127
|
+
Parameters: {"token"=>"M00ZFOT6k7tO7Wyf476fFK5g", "challenge"=>"QFNbV2QeRdi0jNqhy3UXISopZrvhQCykvOuJijt6QBLz2Ds9OBuA", "type"=>"url_verification", "member_joined_channel"=>{"token"=>"M00ZFOT6k7tO7Wyf476fFK5g", "challenge"=>"QFNbV2QeRdi0jNqhy3UXISopZrvhQCykvOuJijt6QBLz2Ds9OBuA", "type"=>"url_verification"}}
|
128
|
+
|
129
|
+
Completed 401 Unauthorized in 15ms (ActiveRecord: 0.0ms)
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
```
|
134
|
+
|
135
|
+
|
136
|
+
|
105
137
|
宜しくお願い致します。
|
1
情報の追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -1,4 +1,6 @@
|
|
1
1
|
###やりたいこと
|
2
|
+
|
3
|
+
docker、Ruby on Rails5.1を使用してwebアプリを作成しています。
|
2
4
|
|
3
5
|
Slackに用意されているイベント、 ```member_joined_channel```を使用し、
|
4
6
|
|