discorb 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 066cdc59fc560a9d91badf19ac7628de7e7d7bf112b6a054ea68e697c7c738f2
4
- data.tar.gz: 29558ecd466f3048aa3a7abac2b64bd526fee442cf7f84e49288e29422f0edc6
3
+ metadata.gz: 2b247a62629770b82d8326ac69507603a27bc8cf31bcf7c06a7aa9d546b7e80a
4
+ data.tar.gz: ec2416663ce7d90e2023c648a115e6a2691f4557394770274dcf4a25489aad36
5
5
  SHA512:
6
- metadata.gz: a8ff733e1fc0caefcfb902584b6a9c2826f0bf1e4372e44cd1cd7a66c32da9a460e7c2b69e26a63812f4d15a2f94b49548496f589b56903c75233045bc4aa66d
7
- data.tar.gz: cec8a40047b30df81c0c8e84f17e1d2aa73ad69204420811ec51427682595060b6632c81eadcef6e4435f831179f2b57f22fd9dc6a01dd8929dc1c56b7e0eddc
6
+ metadata.gz: 511985823e749cec350e08f98cd9b7f05172d00fb02e63756b4c8dadd65657c9a68d775a1309190c14ec72c12ed955a6bfbd7bc23d55307fc90165b5a9d81c63
7
+ data.tar.gz: ba547c5dc8a1558654ae860be8f426255bf633809acb82b853a14b72ffbbda9b58a6d0bc50c6e2b656233b08672ec78be07a4899436f5c90e162b3a06aa45c5f
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- discorb (0.0.7)
4
+ discorb (0.0.8)
5
5
  async
6
6
  async-http
7
7
  async-websocket
data/README.md CHANGED
@@ -35,7 +35,7 @@ client.once :ready do
35
35
  puts "Logged in as #{client.user}"
36
36
  end
37
37
 
38
- client.on :message do |_task, message|
38
+ client.on :message do |message|
39
39
  next if message.author.bot?
40
40
  next unless message.content == "ping"
41
41
 
data/docs/events.md CHANGED
@@ -9,7 +9,7 @@ You can register event handlers with {Client#on}.
9
9
  Alternatively, you can use {Client#once} to register a one-time event handler.
10
10
 
11
11
  ```ruby
12
- client.on :message do |_task, event|
12
+ client.on :message do |event|
13
13
  puts event.message.content
14
14
  end
15
15
  ```
@@ -18,13 +18,9 @@ This example will print the content of every message received.
18
18
 
19
19
  ## Event reference
20
20
 
21
- ### Note
22
-
23
- `Async::Task` object will be passed to the event handler in the first argument: `task`.
24
-
25
21
  ### Client events
26
22
 
27
- #### `event_receive(task, event_name, data)`
23
+ #### `event_receive(event_name, data)`
28
24
  Fires when a event is received.
29
25
 
30
26
  | Parameter | Type | Description |
@@ -42,7 +38,7 @@ Fires when the client is resumed connection.
42
38
 
43
39
  ### Guild events
44
40
 
45
- #### `guild_join(task, guild)`
41
+ #### `guild_join(guild)`
46
42
 
47
43
  Fires when client joins a guild.
48
44
 
@@ -50,7 +46,7 @@ Fires when client joins a guild.
50
46
  | ---------- | ----- | ----------- |
51
47
  |`guild` | {Discorb::Guild} | The guild that was joined. |
52
48
 
53
- #### `guild_available(task, guild)`
49
+ #### `guild_available(guild)`
54
50
 
55
51
  Fires when a guild becomes available.
56
52
 
@@ -58,7 +54,7 @@ Fires when a guild becomes available.
58
54
  | ---------- | ----- | ----------- |
59
55
  |`guild` | {Discorb::Guild} | The guild that became available. |
60
56
 
61
- #### `guild_update(task, before, after)`
57
+ #### `guild_update(before, after)`
62
58
 
63
59
  Fires when client updates a guild.
64
60
 
@@ -67,7 +63,7 @@ Fires when client updates a guild.
67
63
  |`before` | {Discorb::Guild} | The guild before the update. |
68
64
  |`after` | {Discorb::Guild} | The guild after the update. |
69
65
 
70
- #### `guild_leave(task, guild)`
66
+ #### `guild_leave(guild)`
71
67
 
72
68
  Fires when client leaves a guild.
73
69
 
@@ -75,7 +71,7 @@ Fires when client leaves a guild.
75
71
  | ---------- | ----- | ----------- |
76
72
  |`guild` | {Discorb::Guild} | The guild that was left. |
77
73
 
78
- #### `guild_destroy(task, guild)`
74
+ #### `guild_destroy(guild)`
79
75
 
80
76
  Fires when guild is destroyed.
81
77
 
@@ -83,7 +79,7 @@ Fires when guild is destroyed.
83
79
  | ---------- | ----- | ----------- |
84
80
  |`guild` | {Discorb::Guild} | The guild that was destroyed. |
85
81
 
86
- #### `guild_integrations_update(task, guild)`
82
+ #### `guild_integrations_update(guild)`
87
83
 
88
84
  Fires when guild integrations are updated.
89
85
 
@@ -91,7 +87,7 @@ Fires when guild integrations are updated.
91
87
  | ---------- | ----- | ----------- |
92
88
  |`guild` | {Discorb::Guild} | The guild that integrations were updated for. |
93
89
 
94
- #### `guild_ban_add(task, guild, user)`
90
+ #### `guild_ban_add(guild, user)`
95
91
 
96
92
  Fires when a user is banned from a guild.
97
93
 
@@ -101,7 +97,7 @@ Fires when a user is banned from a guild.
101
97
  |`guild` | {Discorb::Guild} | The guild that the user was banned from. |
102
98
  |`user` | {Discorb::User} | The user that was banned. |
103
99
 
104
- #### `guild_ban_remove(task, guild, user)`
100
+ #### `guild_ban_remove(guild, user)`
105
101
 
106
102
  Fires when a user is unbanned from a guild.
107
103
 
@@ -112,7 +108,7 @@ Fires when a user is unbanned from a guild.
112
108
 
113
109
  ### Channel events
114
110
 
115
- #### `channel_create(task, channel)`
111
+ #### `channel_create(channel)`
116
112
 
117
113
  Fires when a channel is created.
118
114
 
@@ -120,7 +116,7 @@ Fires when a channel is created.
120
116
  | ---------- | ----- | ----------- |
121
117
  |`channel` | {Discorb::Channel} | The channel that was created. |
122
118
 
123
- #### `channel_update(task, before, after)`
119
+ #### `channel_update(before, after)`
124
120
 
125
121
  Fires when a channel is updated.
126
122
 
@@ -129,7 +125,7 @@ Fires when a channel is updated.
129
125
  |`before` | {Discorb::Channel} | The channel before the update. |
130
126
  |`after` | {Discorb::Channel} | The channel after the update. |
131
127
 
132
- #### `channel_delete(task, channel)`
128
+ #### `channel_delete(channel)`
133
129
 
134
130
  Fires when a channel is deleted.
135
131
 
@@ -137,7 +133,7 @@ Fires when a channel is deleted.
137
133
  | ---------- | ----- | ----------- |
138
134
  |`channel` | {Discorb::Channel} | The channel that was deleted. |
139
135
 
140
- #### `webhooks_update(task, event)`
136
+ #### `webhooks_update(event)`
141
137
 
142
138
  Fires when a webhook is updated.
143
139
 
@@ -145,7 +141,7 @@ Fires when a webhook is updated.
145
141
  | ---------- | ----- | ----------- |
146
142
  |`event` | {Discorb::WebhooksUpdateEvent} | The webhook update event. |
147
143
 
148
- #### `thread_new(task, thread)`
144
+ #### `thread_new(thread)`
149
145
 
150
146
  Fires when a thread is created.
151
147
 
@@ -153,7 +149,7 @@ Fires when a thread is created.
153
149
  | ---------- | ----- | ----------- |
154
150
  |`thread` | {Discorb::ThreadChannel} | The thread that was created. |
155
151
 
156
- #### `thread_join(task, thread)`
152
+ #### `thread_join(thread)`
157
153
 
158
154
  Fires when client joins a thread.
159
155
 
@@ -162,7 +158,7 @@ Fires when client joins a thread.
162
158
  |`thread` | {Discorb::ThreadChannel} | The thread that was joined. |
163
159
 
164
160
 
165
- #### `thread_delete(task, thread)`
161
+ #### `thread_delete(thread)`
166
162
 
167
163
  Fires when a thread is deleted.
168
164
 
@@ -170,7 +166,7 @@ Fires when a thread is deleted.
170
166
  | ---------- | ----- | ----------- |
171
167
  |`thread` | {Discorb::ThreadChannel} | The thread that was deleted. |
172
168
 
173
- #### `thread_update(task, before, after)`
169
+ #### `thread_update(before, after)`
174
170
 
175
171
  Fires when a thread is updated.
176
172
 
@@ -179,7 +175,7 @@ Fires when a thread is updated.
179
175
  |`before` | {Discorb::ThreadChannel} | The thread before the update. |
180
176
  |`after` | {Discorb::ThreadChannel} | The thread after the update. |
181
177
 
182
- #### `thread_members_update(task, thread, added, removed)`
178
+ #### `thread_members_update(thread, added, removed)`
183
179
 
184
180
  Fires when a thread's members are updated.
185
181
 
@@ -189,7 +185,7 @@ Fires when a thread's members are updated.
189
185
  |`added` | Array<{ThreadChannel::Member}> | An array of {Discorb::ThreadChannel::Member} objects that were added to the thread. |
190
186
  |`removed` | Array<{ThreadChannel::Member}> | An array of {Discorb::ThreadChannel::Member} objects that were removed from the thread. |
191
187
 
192
- #### `thread_member_update(task, before, after)`
188
+ #### `thread_member_update(before, after)`
193
189
 
194
190
  Fires when a thread member is updated.
195
191
 
@@ -201,7 +197,7 @@ Fires when a thread member is updated.
201
197
 
202
198
  ### Integration events
203
199
 
204
- #### `integration_create(task, integration)`
200
+ #### `integration_create(integration)`
205
201
 
206
202
  Fires when a guild integration is created.
207
203
 
@@ -209,7 +205,7 @@ Fires when a guild integration is created.
209
205
  | ---------- | ----- | ----------- |
210
206
  |`integration`| {Discorb::Integration}| The created integration. |
211
207
 
212
- #### `integration_update(task, before, after)`
208
+ #### `integration_update(before, after)`
213
209
 
214
210
  Fires when a guild integration is updated.
215
211
 
@@ -219,7 +215,7 @@ Fires when a guild integration is updated.
219
215
  |`before` | {Discorb::Integration}| The integration before the update. |
220
216
  |`after` | {Discorb::Integration}| The integration after the update. |
221
217
 
222
- #### `integration_delete(task, integration)`
218
+ #### `integration_delete(integration)`
223
219
 
224
220
  Fires when a guild integration is deleted.
225
221
 
@@ -229,7 +225,7 @@ Fires when a guild integration is deleted.
229
225
 
230
226
  ### Message events
231
227
 
232
- #### `message(task, message)`
228
+ #### `message(message)`
233
229
 
234
230
  Fires when a message is created.
235
231
 
@@ -237,7 +233,7 @@ Fires when a message is created.
237
233
  | ---------- | ----- | ----------- |
238
234
  |`message` | {Discorb::Message}| The created message. |
239
235
 
240
- #### `message_update(task, event)`
236
+ #### `message_update(event)`
241
237
 
242
238
  Fires when a message is updated.
243
239
 
@@ -245,7 +241,7 @@ Fires when a message is updated.
245
241
  | ---------- | ----- | ----------- |
246
242
  |`event` | {Discorb::GatewayHandler::MessageUpdateEvent}| The message after the update. |
247
243
 
248
- #### `message_delete(task, message, channel, guild)`
244
+ #### `message_delete(message, channel, guild)`
249
245
 
250
246
  Fires when a message is deleted.
251
247
 
@@ -259,7 +255,7 @@ Fires when a message is deleted.
259
255
 
260
256
  This will fire when cached messages are deleted.
261
257
 
262
- #### `message_delete_id(task, message_id, channel, guild)`
258
+ #### `message_delete_id(message_id, channel, guild)`
263
259
 
264
260
  Fires when a message is deleted.
265
261
  Not like {#message_delete} this will fire even message is not cached.
@@ -270,7 +266,7 @@ Not like {#message_delete} this will fire even message is not cached.
270
266
  |`channel` | {Discorb::Channel}| The channel the message was deleted from. |
271
267
  |`guild` | ?{Discorb::Guild} | The guild the message was deleted from. |
272
268
 
273
- #### `message_delete_bulk(task, messages)`
269
+ #### `message_delete_bulk(messages)`
274
270
 
275
271
  Fires when a bulk of messages are deleted.
276
272
 
@@ -278,7 +274,7 @@ Fires when a bulk of messages are deleted.
278
274
  | ---------- | ----- | ----------- |
279
275
  |`messages` | Array<{Discorb::Message}, {Discorb::GatewayHandler::UnknownDeleteBulkMessage}> | The deleted messages. |
280
276
 
281
- #### `message_pin_update(task, event)`
277
+ #### `message_pin_update(event)`
282
278
 
283
279
  Fires when a message is pinned or unpinned.
284
280
 
@@ -286,7 +282,7 @@ Fires when a message is pinned or unpinned.
286
282
  | ---------- | ----- | ----------- |
287
283
  |`event` | {Discorb::GatewayHandler::MessagePinUpdateEvent}| The event object. |
288
284
 
289
- #### `typing_start(task, event)`
285
+ #### `typing_start(event)`
290
286
 
291
287
  Fires when a user starts typing.
292
288
 
@@ -296,7 +292,7 @@ Fires when a user starts typing.
296
292
 
297
293
  ### Reaction events
298
294
 
299
- #### `reaction_add(task, event)`
295
+ #### `reaction_add(event)`
300
296
 
301
297
  Fires when a reaction is added to a message.
302
298
 
@@ -304,7 +300,7 @@ Fires when a reaction is added to a message.
304
300
  | ---------- | ----- | ----------- |
305
301
  |`event` | {Discorb::GatewayHandler::ReactionEvent}| The event object. |
306
302
 
307
- #### `reaction_remove(task, event)`
303
+ #### `reaction_remove(event)`
308
304
 
309
305
  Fires when someone removes a reaction from a message.
310
306
 
@@ -312,7 +308,7 @@ Fires when someone removes a reaction from a message.
312
308
  | ---------- | ----- | ----------- |
313
309
  |`event` | {Discorb::GatewayHandler::ReactionEvent}| The event object. |
314
310
 
315
- #### `reaction_remove_all(task, event)`
311
+ #### `reaction_remove_all(event)`
316
312
 
317
313
  Fires when all reactions are removed from a message.
318
314
 
@@ -320,7 +316,7 @@ Fires when all reactions are removed from a message.
320
316
  | ---------- | ----- | ----------- |
321
317
  |`event` | {Discorb::GatewayHandler::ReactionRemoveAllEvent}| The event object. |
322
318
 
323
- #### `reaction_remove_emoji(task, event)`
319
+ #### `reaction_remove_emoji(event)`
324
320
 
325
321
  Fires when a reaction is removed from a message.
326
322
 
@@ -330,7 +326,7 @@ Fires when a reaction is removed from a message.
330
326
 
331
327
  ### Role events
332
328
 
333
- #### `role_create(task, role)`
329
+ #### `role_create(role)`
334
330
 
335
331
  Fires when a role is created.
336
332
 
@@ -338,7 +334,7 @@ Fires when a role is created.
338
334
  | ---------- | ----- | ----------- |
339
335
  |`role` | {Discorb::Role}| The created role. |
340
336
 
341
- #### `role_update(task, before, after)`
337
+ #### `role_update(before, after)`
342
338
 
343
339
  Fires when a role is updated.
344
340
 
@@ -347,7 +343,7 @@ Fires when a role is updated.
347
343
  |`before` | {Discorb::Role}| The role before the update. |
348
344
  |`after` | {Discorb::Role}| The role after the update. |
349
345
 
350
- #### `role_remove(task, role)`
346
+ #### `role_remove(role)`
351
347
 
352
348
  Fires when a role is deleted.
353
349
 
@@ -361,7 +357,7 @@ Fires when a role is deleted.
361
357
 
362
358
  These events requires the `guild_members` intent.
363
359
 
364
- #### `member_add(task, member)`
360
+ #### `member_add(member)`
365
361
 
366
362
  Fires when a member joins a guild.
367
363
 
@@ -369,7 +365,7 @@ Fires when a member joins a guild.
369
365
  | ---------- | ----- | ----------- |
370
366
  |`member` | {Discorb::Member}| The member that joined. |
371
367
 
372
- #### `member_update(task, before, after)`
368
+ #### `member_update(before, after)`
373
369
 
374
370
  Fires when a member is updated.
375
371
 
@@ -378,7 +374,7 @@ Fires when a member is updated.
378
374
  |`before` | {Discorb::Member}| The member before the update. |
379
375
  |`after` | {Discorb::Member}| The member after the update. |
380
376
 
381
- #### `member_remove(task, member)`
377
+ #### `member_remove(member)`
382
378
 
383
379
  Fires when a member is removed from a guild.
384
380
 
@@ -388,7 +384,7 @@ Fires when a member is removed from a guild.
388
384
 
389
385
  ### Role events
390
386
 
391
- #### `role_create(task, role)`
387
+ #### `role_create(role)`
392
388
 
393
389
  Fires when a role is created.
394
390
 
@@ -396,7 +392,7 @@ Fires when a role is created.
396
392
  | ---------- | ----- | ----------- |
397
393
  |`role` | {Discorb::Role}| The created role. |
398
394
 
399
- #### `role_update(task, before, after)`
395
+ #### `role_update(before, after)`
400
396
 
401
397
  Fires when a role is updated.
402
398
 
@@ -405,7 +401,7 @@ Fires when a role is updated.
405
401
  |`before` | {Discorb::Role}| The role before the update. |
406
402
  |`after` | {Discorb::Role}| The role after the update. |
407
403
 
408
- #### `role_remove(task, role)`
404
+ #### `role_remove(role)`
409
405
 
410
406
  Fires when a role is deleted.
411
407
 
@@ -415,7 +411,7 @@ Fires when a role is deleted.
415
411
 
416
412
  ### Invite events
417
413
 
418
- #### `invite_create(task, invite)`
414
+ #### `invite_create(invite)`
419
415
 
420
416
  Fires when a invite is created.
421
417
 
@@ -423,7 +419,7 @@ Fires when a invite is created.
423
419
  | ---------- | ----- | ----------- |
424
420
  |`invite` | {Discorb::Invite}| The created invite. |
425
421
 
426
- #### `invite_delete(task, invite)`
422
+ #### `invite_delete(invite)`
427
423
 
428
424
  Fires when a invite is deleted.
429
425
 
@@ -433,7 +429,7 @@ Fires when a invite is deleted.
433
429
 
434
430
  ### Interaction events
435
431
 
436
- #### `button_click(task, interaction)`
432
+ #### `button_click(interaction)`
437
433
 
438
434
  Fires when a button is clicked.
439
435
 
@@ -441,7 +437,7 @@ Fires when a button is clicked.
441
437
  | ---------- | ----- | ----------- |
442
438
  |`interaction`| {Discorb::MessageComponentInteraction::Button}| The interaction object. |
443
439
 
444
- #### `select_menu_select(task, interaction)`
440
+ #### `select_menu_select(interaction)`
445
441
 
446
442
  Fires when a select menu is selected.
447
443
 
@@ -455,7 +451,7 @@ It's too big, so they're documented in {file:docs/voice_events.md}
455
451
 
456
452
  ### Low-level events
457
453
 
458
- #### `guild_create(task, guild)`
454
+ #### `guild_create(guild)`
459
455
 
460
456
  Fires when `GUILD_CREATE` is received.
461
457
 
@@ -463,7 +459,7 @@ Fires when `GUILD_CREATE` is received.
463
459
  | ---------- | ----- | ----------- |
464
460
  |`guild` | {Discorb::Guild}| The guild of the event. |
465
461
 
466
- #### `guild_delete(task, guild)`
462
+ #### `guild_delete(guild)`
467
463
 
468
464
  Fires when `GUILD_DELETE` is received.
469
465
 
@@ -471,7 +467,7 @@ Fires when `GUILD_DELETE` is received.
471
467
  | ---------- | ----- | ----------- |
472
468
  |`guild` | {Discorb::Guild}| The guild of the event. |
473
469
 
474
- #### `thread_create(task, thread)`
470
+ #### `thread_create(thread)`
475
471
 
476
472
  Fires when `THREAD_CREATE` is received.
477
473
 
data/docs/voice_events.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  ### Voice Channel Events
6
6
 
7
- #### `voice_channel_connect(task, state)`
7
+ #### `voice_channel_connect(state)`
8
8
 
9
9
  Fires when someone joins a voice channel.
10
10
 
@@ -12,7 +12,7 @@ Fires when someone joins a voice channel.
12
12
  | --- | --- | --- |
13
13
  | state | {Discorb::VoiceState} | The voice state of the user that joined. |
14
14
 
15
- #### `voice_channel_disconnect(task, state)`
15
+ #### `voice_channel_disconnect(state)`
16
16
 
17
17
  Fires when someone leaves a voice channel.
18
18
 
@@ -20,7 +20,7 @@ Fires when someone leaves a voice channel.
20
20
  | --- | --- | --- |
21
21
  | state | {Discorb::VoiceState} | The voice state of the user that left. |
22
22
 
23
- #### `voice_channel_move(task, before, after)`
23
+ #### `voice_channel_move(before, after)`
24
24
 
25
25
  Fires when someone moves to a different voice channel.
26
26
 
@@ -29,7 +29,7 @@ Fires when someone moves to a different voice channel.
29
29
  | before | {Discorb::VoiceState} | The voice state of the user before the move. |
30
30
  | after | {Discorb::VoiceState} | The voice state of the user after the move. |
31
31
 
32
- #### `voice_channel_update(task, before, after)`
32
+ #### `voice_channel_update(before, after)`
33
33
 
34
34
  Fires when a voice channel is connected, disconnected, or updated.
35
35
 
@@ -40,7 +40,7 @@ Fires when a voice channel is connected, disconnected, or updated.
40
40
 
41
41
  ### Mute Events
42
42
 
43
- #### `voice_mute_disable(task, state)`
43
+ #### `voice_mute_disable(state)`
44
44
 
45
45
  Fires when a user's voice mute is disabled.
46
46
 
@@ -48,7 +48,7 @@ Fires when a user's voice mute is disabled.
48
48
  | --- | --- | --- |
49
49
  | `state` | {Discorb::VoiceState} | The voice state. |
50
50
 
51
- #### `voice_mute_enable(task, state)`
51
+ #### `voice_mute_enable(state)`
52
52
 
53
53
  Fires when a user's voice mute is enabled.
54
54
 
@@ -56,7 +56,7 @@ Fires when a user's voice mute is enabled.
56
56
  | --- | --- | --- |
57
57
  | `state` | {Discorb::VoiceState} | The voice state. |
58
58
 
59
- #### `voice_mute_update(task, before, after)`
59
+ #### `voice_mute_update(before, after)`
60
60
 
61
61
  Fires when a user's voice mute is enabled or disabled.
62
62
 
@@ -65,7 +65,7 @@ Fires when a user's voice mute is enabled or disabled.
65
65
  | `before` | {Discorb::VoiceState} | The voice state before the update. |
66
66
  | `after` | {Discorb::VoiceState} | The voice state after the update. |
67
67
 
68
- #### `voice_server_mute_enable(task, state)`
68
+ #### `voice_server_mute_enable(state)`
69
69
 
70
70
  Fires when a user's server voice mute is enabled.
71
71
 
@@ -73,7 +73,7 @@ Fires when a user's server voice mute is enabled.
73
73
  | --- | --- | --- |
74
74
  | `state` | {Discorb::VoiceState} | The voice state. |
75
75
 
76
- #### `voice_server_mute_disable(task, state)`
76
+ #### `voice_server_mute_disable(state)`
77
77
 
78
78
  Fires when a user's server voice mute is disabled.
79
79
 
@@ -81,7 +81,7 @@ Fires when a user's server voice mute is disabled.
81
81
  | --- | --- | --- |
82
82
  | `state` | {Discorb::VoiceState} | The voice state. |
83
83
 
84
- #### `voice_server_mute_update(task, before, after)`
84
+ #### `voice_server_mute_update(before, after)`
85
85
 
86
86
  Fires when a user's server voice mute is enabled or disabled.
87
87
 
@@ -90,7 +90,7 @@ Fires when a user's server voice mute is enabled or disabled.
90
90
  | `before` | {Discorb::VoiceState} | The voice state before the update. |
91
91
  | `after` | {Discorb::VoiceState} | The voice state after the update. |
92
92
 
93
- #### `voice_self_mute_enable(task, state)`
93
+ #### `voice_self_mute_enable(state)`
94
94
 
95
95
  Fires when a user's self voice mute is enabled.
96
96
 
@@ -98,7 +98,7 @@ Fires when a user's self voice mute is enabled.
98
98
  | --- | --- | --- |
99
99
  | `state` | {Discorb::VoiceState} | The voice state. |
100
100
 
101
- #### `voice_self_mute_disable(task, state)`
101
+ #### `voice_self_mute_disable(state)`
102
102
 
103
103
  Fires when a user's self voice mute is disabled.
104
104
 
@@ -106,7 +106,7 @@ Fires when a user's self voice mute is disabled.
106
106
  | --- | --- | --- |
107
107
  | `state` | {Discorb::VoiceState} | The voice state. |
108
108
 
109
- #### `voice_self_mute_update(task, before, after)`
109
+ #### `voice_self_mute_update(before, after)`
110
110
 
111
111
  Fires when a user's self voice mute is enabled or disabled.
112
112
 
@@ -117,7 +117,7 @@ Fires when a user's self voice mute is enabled or disabled.
117
117
 
118
118
  ### Deaf Events
119
119
 
120
- #### `voice_deaf_enable(task, state)`
120
+ #### `voice_deaf_enable(state)`
121
121
 
122
122
  Fires when a user's voice deaf is enabled.
123
123
 
@@ -125,7 +125,7 @@ Fires when a user's voice deaf is enabled.
125
125
  | --- | --- | --- |
126
126
  | `state` | {Discorb::VoiceState} | The voice state. |
127
127
 
128
- #### `voice_deaf_disable(task, state)`
128
+ #### `voice_deaf_disable(state)`
129
129
 
130
130
  Fires when a user's voice deaf is disabled.
131
131
 
@@ -133,7 +133,7 @@ Fires when a user's voice deaf is disabled.
133
133
  | --- | --- | --- |
134
134
  | `state` | {Discorb::VoiceState} | The voice state. |
135
135
 
136
- #### `voice_deaf_update(task, before, after)`
136
+ #### `voice_deaf_update(before, after)`
137
137
 
138
138
  Fires when a user's voice deaf is enabled or disabled.
139
139
 
@@ -142,7 +142,7 @@ Fires when a user's voice deaf is enabled or disabled.
142
142
  | `before` | {Discorb::VoiceState} | The voice state before the update. |
143
143
  | `after` | {Discorb::VoiceState} | The voice state after the update. |
144
144
 
145
- #### `voice_server_deaf_enable(task, state)`
145
+ #### `voice_server_deaf_enable(state)`
146
146
 
147
147
  Fires when a user's server voice deaf is enabled.
148
148
 
@@ -150,7 +150,7 @@ Fires when a user's server voice deaf is enabled.
150
150
  | --- | --- | --- |
151
151
  | `state` | {Discorb::VoiceState} | The voice state. |
152
152
 
153
- #### `voice_server_deaf_disable(task, state)`
153
+ #### `voice_server_deaf_disable(state)`
154
154
 
155
155
  Fires when a user's server voice deaf is disabled.
156
156
 
@@ -158,7 +158,7 @@ Fires when a user's server voice deaf is disabled.
158
158
  | --- | --- | --- |
159
159
  | `state` | {Discorb::VoiceState} | The voice state. |
160
160
 
161
- #### `voice_server_deaf_update(task, before, after)`
161
+ #### `voice_server_deaf_update(before, after)`
162
162
 
163
163
  Fires when a user's server voice deaf is enabled or disabled.
164
164
 
@@ -167,7 +167,7 @@ Fires when a user's server voice deaf is enabled or disabled.
167
167
  | `before` | {Discorb::VoiceState} | The voice state before the update. |
168
168
  | `after` | {Discorb::VoiceState} | The voice state after the update. |
169
169
 
170
- #### `voice_self_deaf_enable(task, state)`
170
+ #### `voice_self_deaf_enable(state)`
171
171
 
172
172
  Fires when a user's self voice deaf is enabled.
173
173
 
@@ -175,7 +175,7 @@ Fires when a user's self voice deaf is enabled.
175
175
  | --- | --- | --- |
176
176
  | `state` | {Discorb::VoiceState} | The voice state. |
177
177
 
178
- #### `voice_self_deaf_disable(task, state)`
178
+ #### `voice_self_deaf_disable(state)`
179
179
 
180
180
  Fires when a user's self voice deaf is disabled.
181
181
 
@@ -183,7 +183,7 @@ Fires when a user's self voice deaf is disabled.
183
183
  | --- | --- | --- |
184
184
  | `state` | {Discorb::VoiceState} | The voice state. |
185
185
 
186
- #### `voice_self_deaf_update(task, before, after)`
186
+ #### `voice_self_deaf_update(before, after)`
187
187
 
188
188
  | Parameter | Type | Description |
189
189
  | --- | --- | --- |
@@ -192,7 +192,7 @@ Fires when a user's self voice deaf is disabled.
192
192
 
193
193
  ### Stream Events
194
194
 
195
- #### `voice_stream_start(task, state)`
195
+ #### `voice_stream_start(state)`
196
196
 
197
197
  Fires when a stream is started.
198
198
 
@@ -200,7 +200,7 @@ Fires when a stream is started.
200
200
  | --- | --- | --- |
201
201
  | `state` | {Discorb::VoiceState} | The voice state. |
202
202
 
203
- #### `voice_stream_end(task, state)`
203
+ #### `voice_stream_end(state)`
204
204
 
205
205
  Fires when a stream is ended.
206
206
 
@@ -208,7 +208,7 @@ Fires when a stream is ended.
208
208
  | --- | --- | --- |
209
209
  | `state` | {Discorb::VoiceState} | The voice state. |
210
210
 
211
- #### `voice_stream_update(task, before, after)`
211
+ #### `voice_stream_update(before, after)`
212
212
 
213
213
  Fires when a stream is started or ended.
214
214
 
@@ -219,7 +219,7 @@ Fires when a stream is started or ended.
219
219
 
220
220
  ### Video Events
221
221
 
222
- #### `voice_video_start(task, state)`
222
+ #### `voice_video_start(state)`
223
223
 
224
224
  Fires when a video is started.
225
225
 
@@ -227,7 +227,7 @@ Fires when a video is started.
227
227
  | --- | --- | --- |
228
228
  | `state` | {Discorb::VoiceState} | The voice state. |
229
229
 
230
- #### `voice_video_end(task, state)`
230
+ #### `voice_video_end(state)`
231
231
 
232
232
  Fires when a video is ended.
233
233
 
@@ -235,7 +235,7 @@ Fires when a video is ended.
235
235
  | --- | --- | --- |
236
236
  | `state` | {Discorb::VoiceState} | The voice state. |
237
237
 
238
- #### `voice_video_update(task, before, after)`
238
+ #### `voice_video_update(before, after)`
239
239
 
240
240
  Fires when a video is started or ended.
241
241
 
@@ -246,7 +246,7 @@ Fires when a video is started or ended.
246
246
 
247
247
  ### Stage Instances Events
248
248
 
249
- #### `stage_instance_create(task, instance)`
249
+ #### `stage_instance_create(instance)`
250
250
 
251
251
  Fires when a new stage instance is created.
252
252
 
@@ -254,7 +254,7 @@ Fires when a new stage instance is created.
254
254
  | --- | --- | --- |
255
255
  | `instance` | {Discorb::StageInstance} | The created instance. |
256
256
 
257
- #### `stage_instance_delete(task, instance)`
257
+ #### `stage_instance_delete(instance)`
258
258
 
259
259
  Fires when a stage instance is deleted.
260
260
 
@@ -262,7 +262,7 @@ Fires when a stage instance is deleted.
262
262
  | --- | --- | --- |
263
263
  | `instance` | {Discorb::StageInstance} | The deleted instance. |
264
264
 
265
- #### `stage_instance_update(task, before, after)`
265
+ #### `stage_instance_update(before, after)`
266
266
 
267
267
  Fires when a stage instance is updated.
268
268
 
@@ -273,7 +273,7 @@ Fires when a stage instance is updated.
273
273
 
274
274
  ### Misc Events
275
275
 
276
- #### `voice_state_update(task, before, after)`
276
+ #### `voice_state_update(before, after)`
277
277
 
278
278
  Fired when a user changes voice state.
279
279
 
@@ -12,7 +12,7 @@ client.once :ready do
12
12
  puts "Logged in as #{client.user}"
13
13
  end
14
14
 
15
- client.on :message do |_task, message|
15
+ client.on :message do |message|
16
16
  next if message.author.bot?
17
17
  next unless message.content.start_with?("!auth ")
18
18
 
@@ -32,7 +32,7 @@ client.on :message do |_task, message|
32
32
  )
33
33
  end
34
34
 
35
- client.on :button_click do |_task, response|
35
+ client.on :button_click do |response|
36
36
  if response.custom_id.start_with?("auth:")
37
37
  id = response.custom_id.delete_prefix("auth:")
38
38
  response.fired_by.add_role(id).wait
@@ -36,7 +36,7 @@ client.once :ready do
36
36
  puts "Logged in as #{client.user}"
37
37
  end
38
38
 
39
- client.on :message do |_task, message|
39
+ client.on :message do |message|
40
40
  next if message.author.bot?
41
41
  next unless message.content == "!ruby"
42
42
 
@@ -46,7 +46,7 @@ client.on :message do |_task, message|
46
46
  )
47
47
  end
48
48
 
49
- client.on :select_menu_select do |_task, response|
49
+ client.on :select_menu_select do |response|
50
50
  next unless response.custom_id == "sections"
51
51
 
52
52
  id = response.value.delete_prefix("sections:")
@@ -8,7 +8,7 @@ module MessageExpander
8
8
  "(?<guild>[0-9]{18})/(?<channel>[0-9]{18})/(?<message>[0-9]{18})(?!>)"
9
9
  )
10
10
 
11
- event :message do |_task, message|
11
+ event :message do |message|
12
12
  next if message.author.bot?
13
13
 
14
14
  message.content.to_enum(:scan, @message_regex).map { Regexp.last_match }.each do |match|
@@ -2,11 +2,11 @@ require "discorb"
2
2
 
3
3
  client = Discorb::Client.new
4
4
 
5
- client.once :ready do |_task|
5
+ client.once :ready do
6
6
  puts "Logged in as #{client.user}"
7
7
  end
8
8
 
9
- client.on :message do |_task, message|
9
+ client.on :message do |message|
10
10
  next if message.author.bot?
11
11
  next unless message.content.start_with?("eval ")
12
12
 
@@ -6,7 +6,7 @@ client.once :ready do
6
6
  puts "Logged in as #{client.user}"
7
7
  end
8
8
 
9
- client.on :message do |_task, message|
9
+ client.on :message do |message|
10
10
  next if message.author.bot?
11
11
  next unless message.content == "ping"
12
12
 
@@ -13,7 +13,7 @@ client.once :ready do
13
13
  puts "Logged in as #{client.user}"
14
14
  end
15
15
 
16
- client.on :reaction_add do |_task, event|
16
+ client.on :reaction_add do |event|
17
17
  next unless event.emoji.value.end_with?(0x0000fe0f.chr("utf-8") + 0x000020e3.chr("utf-8"))
18
18
  next if event.member.bot?
19
19
 
@@ -28,7 +28,7 @@ client.on :reaction_add do |_task, event|
28
28
  end
29
29
  end
30
30
 
31
- client.on :reaction_remove do |_task, event|
31
+ client.on :reaction_remove do |event|
32
32
  next unless event.emoji.value.end_with?(0x0000fe0f.chr("utf-8") + 0x000020e3.chr("utf-8"))
33
33
  next if event.member.bot?
34
34
 
@@ -43,7 +43,7 @@ client.on :reaction_remove do |_task, event|
43
43
  end
44
44
  end
45
45
 
46
- client.on :message do |_task, message|
46
+ client.on :message do |message|
47
47
  next unless message.content.start_with?("/rp ")
48
48
  next if message.author.bot?
49
49
 
@@ -6,7 +6,7 @@ client.once :ready do
6
6
  puts "Logged in as #{client.user}"
7
7
  end
8
8
 
9
- client.on :message do |_task, message|
9
+ client.on :message do |message|
10
10
  next if message.author.bot?
11
11
  next unless message.content == "!quiz"
12
12
 
@@ -124,7 +124,7 @@ module Discorb
124
124
  # @param [Object] args The arguments to pass to the event.
125
125
  #
126
126
  def dispatch(event_name, *args)
127
- Async do |_task|
127
+ Async do
128
128
  if (conditions = @conditions[event_name])
129
129
  ids = Set[*conditions.map(&:first).map(&:object_id)]
130
130
  conditions.delete_if do |condition|
@@ -148,7 +148,7 @@ module Discorb
148
148
  lambda { |event_args|
149
149
  Async(annotation: "Discorb event: #{event_name}") do |task|
150
150
  @events[event_name].delete(block) if block.discriminator[:once]
151
- block.call(task, *event_args)
151
+ block.call(*event_args)
152
152
  @log.debug "Dispatched proc with ID #{block.id.inspect}"
153
153
  rescue StandardError, ScriptError => e
154
154
  message = "An error occurred while dispatching proc with ID #{block.id.inspect}\n#{e.full_message}"
@@ -293,7 +293,7 @@ module Discorb
293
293
  end
294
294
  payload[:status] = status unless status.nil?
295
295
  if @connection
296
- Async do |_task|
296
+ Async do
297
297
  send_gateway(3, **payload)
298
298
  end
299
299
  else
@@ -4,7 +4,7 @@ module Discorb
4
4
  # @return [String] The API base URL.
5
5
  API_BASE_URL = "https://discord.com/api/v9"
6
6
  # @return [String] The version of discorb.
7
- VERSION = "0.0.7"
7
+ VERSION = "0.0.8"
8
8
  # @return [String] The user agent for the bot.
9
9
  USER_AGENT = "DiscordBot (https://github.com/discorb-lib/discorb #{VERSION}) Ruby/#{RUBY_VERSION}"
10
10
 
@@ -89,7 +89,7 @@ module Discorb
89
89
  #
90
90
  # @return [Discorb::Message] The message.
91
91
  def fetch_message(force: false)
92
- Async do |_task|
92
+ Async do
93
93
  next @message if !force && @message
94
94
 
95
95
  @message = @channel.fetch_message(@message_id).wait
@@ -138,7 +138,7 @@ module Discorb
138
138
  #
139
139
  # @return [Discorb::Message] The message.
140
140
  def fetch_message(force: false)
141
- Async do |_task|
141
+ Async do
142
142
  next @message if !force && @message
143
143
 
144
144
  @message = @channel.fetch_message(@message_id).wait
@@ -190,7 +190,7 @@ module Discorb
190
190
  #
191
191
  # @return [Discorb::Message] The message.
192
192
  def fetch_message(force: false)
193
- Async do |_task|
193
+ Async do
194
194
  next @message if !force && @message
195
195
 
196
196
  @message = @channel.fetch_message(@message_id).wait
@@ -455,7 +455,7 @@ module Discorb
455
455
 
456
456
  def connect_gateway(first)
457
457
  @log.info "Connecting to gateway."
458
- Async do |_task|
458
+ Async do
459
459
  @http = HTTP.new(self) if first
460
460
  @first = first
461
461
  _, gateway_response = @http.get("/gateway").wait
@@ -239,7 +239,7 @@ module Discorb
239
239
  # @param (see #post)
240
240
  # @return [Discorb::Message] The message.
241
241
  def reply(*args, **kwargs)
242
- Async do |_task|
242
+ Async do
243
243
  channel.post(*args, reference: self, **kwargs).wait
244
244
  end
245
245
  end
@@ -250,7 +250,7 @@ module Discorb
250
250
  # @macro http
251
251
  #
252
252
  def publish
253
- Async do |_task|
253
+ Async do
254
254
  channel.post("/channels/#{@channel_id}/messages/#{@id}/crosspost", nil).wait
255
255
  end
256
256
  end
@@ -263,7 +263,7 @@ module Discorb
263
263
  # @param [Discorb::Emoji] emoji The emoji to react with.
264
264
  #
265
265
  def add_reaction(emoji)
266
- Async do |_task|
266
+ Async do
267
267
  @client.http.put("/channels/#{@channel_id}/messages/#{@id}/reactions/#{emoji.to_uri}/@me", nil).wait
268
268
  end
269
269
  end
@@ -278,7 +278,7 @@ module Discorb
278
278
  # @param [Discorb::Emoji] emoji The emoji to remove.
279
279
  #
280
280
  def remove_reaction(emoji)
281
- Async do |_task|
281
+ Async do
282
282
  @client.http.delete("/channels/#{@channel_id}/messages/#{@id}/reactions/#{emoji.to_uri}/@me").wait
283
283
  end
284
284
  end
@@ -294,7 +294,7 @@ module Discorb
294
294
  # @param [Discorb::Member] member The member to remove the reaction from.
295
295
  #
296
296
  def remove_reaction_of(emoji, member)
297
- Async do |_task|
297
+ Async do
298
298
  @client.http.delete("/channels/#{@channel_id}/messages/#{@id}/reactions/#{emoji.to_uri}/#{member.is_a?(Member) ? member.id : member}").wait
299
299
  end
300
300
  end
@@ -313,7 +313,7 @@ module Discorb
313
313
  # @return [Array<Discorb::User>] The users.
314
314
  #
315
315
  def fetch_reacted_users(emoji, limit: nil, after: 0)
316
- Async do |_task|
316
+ Async do
317
317
  if limit.nil? || !limit.positive?
318
318
  after = 0
319
319
  users = []
@@ -22,7 +22,7 @@ module Discorb
22
22
  #
23
23
  def post(content = nil, tts: false, embed: nil, embeds: nil, allowed_mentions: nil,
24
24
  reference: nil, components: nil, file: nil, files: nil)
25
- Async do |_task|
25
+ Async do
26
26
  payload = {}
27
27
  payload[:content] = content if content
28
28
  payload[:tts] = tts
@@ -62,7 +62,7 @@ module Discorb
62
62
  #
63
63
  def post(content = nil, tts: false, embed: nil, embeds: nil, allowed_mentions: nil,
64
64
  file: nil, files: nil, username: nil, avatar_url: :unset, wait: true)
65
- Async do |_task|
65
+ Async do
66
66
  payload = {}
67
67
  payload[:content] = content if content
68
68
  payload[:tts] = tts
@@ -102,7 +102,7 @@ module Discorb
102
102
  # @param [Discorb::GuildChannel] channel The new channel of the webhook.
103
103
  #
104
104
  def edit(name: :unset, avatar: :unset, channel: :unset)
105
- Async do |_task|
105
+ Async do
106
106
  payload = {}
107
107
  payload[:name] = name if name != :unset
108
108
  payload[:avatar] = avatar if avatar != :unset
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: discorb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - sevenc-nanashi