chat_sdk-discord 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/discord/adapter.rb +12 -0
- data/lib/chat_sdk/discord/api_client.rb +13 -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: 87f321c87d017327988d70492309baa69a5958ab349234de5412b61177cade6e
|
|
4
|
+
data.tar.gz: 9c1bfe791965272de17234678f78e79a81306e3c26bfd35da1fa2bcf62a74608
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e0434c876314432b1c143b27875b7e434cfe2c359174bbec179c1023f588a134ec0ac292ae44e899be068bd7c8cf2ca16bcda552284fa597395c925fcd4921cb
|
|
7
|
+
data.tar.gz: 2007d22af8c4458ec9d72b0244f99f461af5cef7e38d5a6881a54cf5350d5ef76e94b640159f92e84acc109a06c8cd992c2ae68d55afa515cd937763a343d4f0
|
|
@@ -150,6 +150,18 @@ module ChatSDK
|
|
|
150
150
|
@client.trigger_typing(channel_id)
|
|
151
151
|
end
|
|
152
152
|
|
|
153
|
+
def fetch_thread(channel_id:, thread_id: nil)
|
|
154
|
+
@client.get_channel(channel_id)
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
def set_thread_title(channel_id:, title:)
|
|
158
|
+
@client.modify_channel(channel_id, name: title)
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
def create_thread(channel_id:, message_id:, name:)
|
|
162
|
+
@client.start_thread(channel_id, message_id, name: name)
|
|
163
|
+
end
|
|
164
|
+
|
|
153
165
|
def mention(user_id)
|
|
154
166
|
"<@#{user_id}>"
|
|
155
167
|
end
|
|
@@ -61,6 +61,19 @@ module ChatSDK
|
|
|
61
61
|
request(:get, path)
|
|
62
62
|
end
|
|
63
63
|
|
|
64
|
+
# Channels / Threads
|
|
65
|
+
def get_channel(channel_id)
|
|
66
|
+
request(:get, "#{API_PREFIX}/channels/#{channel_id}")
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
def modify_channel(channel_id, name:)
|
|
70
|
+
request(:patch, "#{API_PREFIX}/channels/#{channel_id}", {"name" => name})
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
def start_thread(channel_id, message_id, name:)
|
|
74
|
+
request(:post, "#{API_PREFIX}/channels/#{channel_id}/messages/#{message_id}/threads", {"name" => name})
|
|
75
|
+
end
|
|
76
|
+
|
|
64
77
|
# Typing indicator
|
|
65
78
|
def trigger_typing(channel_id)
|
|
66
79
|
request(:post, "#{API_PREFIX}/channels/#{channel_id}/typing")
|