chat_sdk-discord 0.4.0 → 0.5.0
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/discord/adapter.rb +6 -1
- data/lib/chat_sdk/discord/api_client.rb +5 -0
- 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: e915045ed20b416f3e22acb6eeeda3310d72c2e1cb77473bfc258f9ad8a6b4db
|
|
4
|
+
data.tar.gz: a8076931f75e9ab8a80a827e1f1ff8df60e0ae73495128f413c741336b8f9b9f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b483c30b3d080b80833cb369949abcd7bc7aa6052608b652e9202757f56598527251f87b2c0421328611521a7e2fb94d159b7c8e4f6dd0df8b48342fffb92587
|
|
7
|
+
data.tar.gz: 037de90729fd37fb70228fb87426926c3c54c33a455bf6d9eab49327b97859325efae5f47be1dc189fbbe9ba7b00324976121f0274a629d4a400cc0aee6f47cd
|
|
@@ -4,7 +4,8 @@ module ChatSDK
|
|
|
4
4
|
module Discord
|
|
5
5
|
class Adapter < ChatSDK::Adapter::Base
|
|
6
6
|
capabilities :edit_messages, :delete_messages, :reactions, :file_uploads,
|
|
7
|
-
:threads, :direct_messages, :message_history, :streaming_edit
|
|
7
|
+
:threads, :direct_messages, :message_history, :streaming_edit,
|
|
8
|
+
:typing_indicator
|
|
8
9
|
|
|
9
10
|
attr_reader :client
|
|
10
11
|
|
|
@@ -132,6 +133,10 @@ module ChatSDK
|
|
|
132
133
|
[messages, next_cursor]
|
|
133
134
|
end
|
|
134
135
|
|
|
136
|
+
def start_typing(channel_id:, thread_id: nil)
|
|
137
|
+
@client.trigger_typing(channel_id)
|
|
138
|
+
end
|
|
139
|
+
|
|
135
140
|
def mention(user_id)
|
|
136
141
|
"<@#{user_id}>"
|
|
137
142
|
end
|
|
@@ -56,6 +56,11 @@ module ChatSDK
|
|
|
56
56
|
request(:get, path)
|
|
57
57
|
end
|
|
58
58
|
|
|
59
|
+
# Typing indicator
|
|
60
|
+
def trigger_typing(channel_id)
|
|
61
|
+
request(:post, "#{API_PREFIX}/channels/#{channel_id}/typing")
|
|
62
|
+
end
|
|
63
|
+
|
|
59
64
|
# File upload
|
|
60
65
|
def upload_file(channel_id, io, filename)
|
|
61
66
|
payload = {
|