chat_sdk-slack 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/chat_sdk/slack/adapter.rb +25 -2
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f3267f830fd79846f929e7e61be15c2b65d1e6183f6f5d56271f88fbb6fdf85b
|
|
4
|
+
data.tar.gz: 9fe0cd67184ef4561a2e6ccb6d5678f5a639f2b53add2be5ef6436b239a1a7c3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c686e9ac2a237c82166200783289f2310cb57cc3760a4d55b11447fa0f7a746b10ffb40b713d18334f277f3efb91663733977f082cf0152ee96ed387ddbd2ed1
|
|
7
|
+
data.tar.gz: 1e897869f36b3571e31dea33be0e78f9bd46bcbc5e3c839da11453337242378933dcfec8eec289ceb4c6cbae4c339bce0a1c4399f39fe74a7980703f5e1e4c40
|
|
@@ -267,6 +267,10 @@ module ChatSDK
|
|
|
267
267
|
client.views_open(trigger_id: trigger_id, view: view)
|
|
268
268
|
end
|
|
269
269
|
|
|
270
|
+
def update_modal(view_id:, modal:)
|
|
271
|
+
client.views_update(view_id: view_id, view: @modal_renderer.render(modal))
|
|
272
|
+
end
|
|
273
|
+
|
|
270
274
|
def publish_home_view(user_id:, view:)
|
|
271
275
|
client.views_publish(user_id: user_id, view: view)
|
|
272
276
|
end
|
|
@@ -295,6 +299,21 @@ module ChatSDK
|
|
|
295
299
|
)
|
|
296
300
|
end
|
|
297
301
|
|
|
302
|
+
def send_to_response_url(response_url:, message:)
|
|
303
|
+
msg = ChatSDK::PostableMessage.from(message)
|
|
304
|
+
payload = {}
|
|
305
|
+
apply_message_params(payload, msg)
|
|
306
|
+
Faraday.post(response_url) do |req|
|
|
307
|
+
req.headers["Content-Type"] = "application/json"
|
|
308
|
+
req.body = JSON.generate(payload)
|
|
309
|
+
end
|
|
310
|
+
end
|
|
311
|
+
|
|
312
|
+
def fetch_thread(channel_id:, thread_id: nil)
|
|
313
|
+
result = client.conversations_info(channel: channel_id)
|
|
314
|
+
result["channel"]
|
|
315
|
+
end
|
|
316
|
+
|
|
298
317
|
def start_typing(channel_id:, thread_id: nil)
|
|
299
318
|
# Slack doesn't have a native typing indicator API for bots
|
|
300
319
|
# This is a no-op but the capability is declared for streaming support
|
|
@@ -312,8 +331,12 @@ module ChatSDK
|
|
|
312
331
|
app_token ||= ENV["SLACK_APP_TOKEN"]
|
|
313
332
|
raise ChatSDK::ConfigurationError, "Slack app_token required for socket mode" unless app_token
|
|
314
333
|
|
|
315
|
-
|
|
316
|
-
|
|
334
|
+
@socket_mode = SocketMode.new(app_token: app_token, bot_client: client)
|
|
335
|
+
@socket_mode.start(&block)
|
|
336
|
+
end
|
|
337
|
+
|
|
338
|
+
def stop_socket_mode
|
|
339
|
+
@socket_mode&.stop
|
|
317
340
|
end
|
|
318
341
|
|
|
319
342
|
def mention(user_id)
|