discord_rda 0.1.3 → 0.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 53c5128ffda5f61e3d0e5aea868f9e93bafa82d98151d79f7c6739e8d185f1f9
4
- data.tar.gz: 9d73432141274e3bbc8905fe7ddba98691ea64e7fd2381ffd9de1833a0a733f8
3
+ metadata.gz: d960d7a22ca5c98ca29977ef83f97a4f4e3c21356d824f4ab444cd32784d946a
4
+ data.tar.gz: e2582c65742fc5d336b8a0b3456ca2ecc9c6d40f93fbd85e6448583a4757305a
5
5
  SHA512:
6
- metadata.gz: 568d5fcbb987b97e5ba71f793346d536a6433b22398cdc32f04d2df43ced244f7a8215f818f942313e19a8b95e9c02d31dd99aac39fc1cb557648cbe7783081b
7
- data.tar.gz: 861a6cbd6e0dba4b88e1ce6fcec261c700541493a0802384321d4bd3975ba64fc952d17c41736e28854e602ea58df9361e048bb148c74fdbd4cc9ea743bbe7ae
6
+ metadata.gz: 7a39158b307ed8d71bd6ca5ddbe2a12e375ef138faef0c64ee615dda22e61d41ef52c5e2ef8841c1940bef440208e46a06c9c2a73fba2dd05635158eea26d980
7
+ data.tar.gz: 94f2dc665860f7d34d9719e58111420d5b841d5abe77b32768e0d8115f68ca662f776288a0dd22e6cd42ee9b9514ddd4168d212f311086b05775bb66307f63f7
data/README.md CHANGED
@@ -7,6 +7,8 @@
7
7
 
8
8
  DiscordRDA (Ruby Development API) is a high-performance Ruby library for building Discord bots with modern async patterns, comprehensive Slash Command support, Component V2 architecture, and enterprise-grade scalability features.
9
9
 
10
+ The library now exposes a much broader Discord REST surface than the original quick-start examples show, including thread lifecycle helpers, webhook message management, invite creation, guild widget and onboarding endpoints, and current-user OAuth2 convenience methods.
11
+
10
12
  ## Features
11
13
 
12
14
  ### Core Capabilities
@@ -26,11 +28,20 @@ DiscordRDA (Ruby Development API) is a high-performance Ruby library for buildin
26
28
  - **Component V2**: Latest Discord components (buttons, selects, containers)
27
29
 
28
30
  ### Enterprise Features
31
+ - **Instant Restarts**: Exec-based restart flow that preserves gateway resume state
29
32
  - **Zero-Downtime Resharding**: Add shards without stopping the bot
30
33
  - **Hot Reload**: File system event-based code reloading
31
34
  - **Session Transfer**: Migrate guilds between shards seamlessly
32
35
  - **REST Proxy Support**: Horizontal scaling with proxy servers
33
36
  - **State Preservation**: Maintain sessions across reloads
37
+ - **Execution Supervision**: Command timeouts, concurrency limits, and failure circuit breaking
38
+
39
+ ### Extended REST Coverage
40
+ - **Threads**: Create, join, leave, archive, and manage thread members
41
+ - **Webhooks**: Fetch, mutate, and edit webhook-owned messages
42
+ - **Guild Admin**: Invites, prune, widget, vanity URL, welcome screen, onboarding
43
+ - **Current User**: DM creation, guild listing, connections, role connections
44
+ - **Persistence**: Built-in ActiveRecord bootstrap and migration helpers
34
45
 
35
46
  ## Installation
36
47
 
@@ -142,6 +153,58 @@ bot.context_menu(type: :user, name: 'High Five') do |interaction|
142
153
  end
143
154
  ```
144
155
 
156
+ ## REST Helpers
157
+
158
+ ```ruby
159
+ # Create a thread from a message
160
+ thread = bot.start_thread_from_message(
161
+ channel_id,
162
+ message_id,
163
+ name: 'incident-review',
164
+ auto_archive_duration: 1440
165
+ )
166
+
167
+ # Create a channel invite with the DSL builder
168
+ invite = bot.create_channel_invite(channel_id) do |builder|
169
+ builder.max_age(3600).max_uses(5).temporary
170
+ end
171
+
172
+ # Edit a webhook message
173
+ bot.edit_webhook_message(webhook_id, webhook_token, message_id, content: 'Updated from DiscordRDA')
174
+ ```
175
+
176
+ ## Resilience
177
+
178
+ ```ruby
179
+ bot.slash('rebuild', 'Run a risky rebuild task') do |cmd|
180
+ cmd.timeout(10)
181
+ cmd.max_concurrency(1)
182
+ cmd.circuit_breaker(failures: 3, cooldown: 120)
183
+
184
+ cmd.handler do |interaction|
185
+ interaction.respond(content: 'Started safely', ephemeral: true)
186
+ end
187
+ end
188
+
189
+ # For memory-bound or untrusted work, use an isolated subprocess:
190
+ result = bot.supervisor.run_isolated(
191
+ ruby_code: "puts({ ok: true }.to_json)",
192
+ timeout_seconds: 5,
193
+ memory_limit_mb: 128
194
+ )
195
+ ```
196
+
197
+ ## ActiveRecord
198
+
199
+ ```ruby
200
+ bot.enable_active_record(database_url: ENV['DATABASE_URL'])
201
+
202
+ class GuildSetting < DiscordRDA::Record
203
+ end
204
+
205
+ bot.active_record.migrate
206
+ ```
207
+
145
208
  ## Components
146
209
 
147
210
  ### Button Components