discorb 0.18.0 → 0.20.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.
Files changed (149) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/build_version.yml +2 -2
  3. data/.rubocop.yml +12 -75
  4. data/Changelog.md +25 -0
  5. data/Gemfile +4 -4
  6. data/README.md +2 -1
  7. data/Rakefile +482 -459
  8. data/Steepfile +8 -6
  9. data/docs/application_command.md +1 -0
  10. data/docs/events.md +2 -2
  11. data/docs/voice_events.md +6 -6
  12. data/lib/discorb/allowed_mentions.rb +68 -72
  13. data/lib/discorb/app_command/command.rb +466 -394
  14. data/lib/discorb/app_command/common.rb +65 -25
  15. data/lib/discorb/app_command/handler.rb +304 -265
  16. data/lib/discorb/app_command.rb +5 -5
  17. data/lib/discorb/application.rb +198 -197
  18. data/lib/discorb/asset.rb +101 -101
  19. data/lib/discorb/attachment.rb +134 -119
  20. data/lib/discorb/audit_logs.rb +412 -385
  21. data/lib/discorb/automod.rb +279 -269
  22. data/lib/discorb/channel/base.rb +107 -108
  23. data/lib/discorb/channel/category.rb +32 -32
  24. data/lib/discorb/channel/container.rb +44 -44
  25. data/lib/discorb/channel/dm.rb +26 -28
  26. data/lib/discorb/channel/guild.rb +311 -246
  27. data/lib/discorb/channel/stage.rb +156 -140
  28. data/lib/discorb/channel/text.rb +430 -336
  29. data/lib/discorb/channel/thread.rb +374 -325
  30. data/lib/discorb/channel/voice.rb +85 -79
  31. data/lib/discorb/channel.rb +5 -5
  32. data/lib/discorb/client.rb +635 -623
  33. data/lib/discorb/color.rb +178 -182
  34. data/lib/discorb/common.rb +168 -164
  35. data/lib/discorb/components/button.rb +107 -106
  36. data/lib/discorb/components/select_menu.rb +157 -145
  37. data/lib/discorb/components/text_input.rb +103 -106
  38. data/lib/discorb/components.rb +68 -66
  39. data/lib/discorb/dictionary.rb +135 -135
  40. data/lib/discorb/embed.rb +404 -398
  41. data/lib/discorb/emoji.rb +309 -302
  42. data/lib/discorb/emoji_table.rb +16099 -8857
  43. data/lib/discorb/error.rb +131 -131
  44. data/lib/discorb/event.rb +360 -314
  45. data/lib/discorb/event_handler.rb +39 -39
  46. data/lib/discorb/exe/about.rb +17 -17
  47. data/lib/discorb/exe/irb.rb +72 -67
  48. data/lib/discorb/exe/new.rb +323 -315
  49. data/lib/discorb/exe/run.rb +69 -68
  50. data/lib/discorb/exe/setup.rb +57 -55
  51. data/lib/discorb/exe/show.rb +12 -12
  52. data/lib/discorb/extend.rb +25 -45
  53. data/lib/discorb/extension.rb +89 -83
  54. data/lib/discorb/flag.rb +126 -128
  55. data/lib/discorb/gateway.rb +984 -794
  56. data/lib/discorb/gateway_events.rb +670 -638
  57. data/lib/discorb/gateway_requests.rb +45 -48
  58. data/lib/discorb/guild.rb +2115 -1626
  59. data/lib/discorb/guild_template.rb +280 -241
  60. data/lib/discorb/http.rb +247 -232
  61. data/lib/discorb/image.rb +42 -42
  62. data/lib/discorb/integration.rb +169 -161
  63. data/lib/discorb/intents.rb +161 -163
  64. data/lib/discorb/interaction/autocomplete.rb +76 -62
  65. data/lib/discorb/interaction/command.rb +279 -224
  66. data/lib/discorb/interaction/components.rb +114 -104
  67. data/lib/discorb/interaction/modal.rb +36 -32
  68. data/lib/discorb/interaction/response.rb +379 -330
  69. data/lib/discorb/interaction/root.rb +271 -118
  70. data/lib/discorb/interaction.rb +5 -5
  71. data/lib/discorb/invite.rb +154 -153
  72. data/lib/discorb/member.rb +344 -311
  73. data/lib/discorb/message.rb +615 -544
  74. data/lib/discorb/message_meta.rb +197 -186
  75. data/lib/discorb/modules.rb +371 -290
  76. data/lib/discorb/permission.rb +305 -289
  77. data/lib/discorb/presence.rb +352 -346
  78. data/lib/discorb/rate_limit.rb +81 -76
  79. data/lib/discorb/reaction.rb +55 -54
  80. data/lib/discorb/role.rb +272 -240
  81. data/lib/discorb/shard.rb +76 -74
  82. data/lib/discorb/sticker.rb +193 -171
  83. data/lib/discorb/user.rb +205 -188
  84. data/lib/discorb/utils/colored_puts.rb +16 -16
  85. data/lib/discorb/utils.rb +12 -16
  86. data/lib/discorb/voice_state.rb +305 -281
  87. data/lib/discorb/webhook.rb +537 -507
  88. data/lib/discorb.rb +62 -56
  89. data/sig/discorb/activity.rbs +1 -0
  90. data/sig/discorb/allowed_mentions.rbs +1 -0
  91. data/sig/discorb/app_command/base.rbs +7 -1
  92. data/sig/discorb/application.rbs +6 -0
  93. data/sig/discorb/asset.rbs +2 -0
  94. data/sig/discorb/attachment.rbs +8 -0
  95. data/sig/discorb/audit_log.rbs +7 -0
  96. data/sig/discorb/automod.rbs +32 -6
  97. data/sig/discorb/avatar.rbs +1 -0
  98. data/sig/discorb/channel/base.rbs +8 -1
  99. data/sig/discorb/channel/category.rbs +1 -0
  100. data/sig/discorb/channel/container.rbs +4 -0
  101. data/sig/discorb/channel/stage.rbs +4 -0
  102. data/sig/discorb/channel/text.rbs +2 -2
  103. data/sig/discorb/channel/thread.rbs +11 -0
  104. data/sig/discorb/channel/voice.rbs +2 -0
  105. data/sig/discorb/client.rbs +21 -20
  106. data/sig/discorb/color.rbs +6 -0
  107. data/sig/discorb/component/base.rbs +1 -0
  108. data/sig/discorb/component/button.rbs +2 -0
  109. data/sig/discorb/component/select_menu.rbs +4 -0
  110. data/sig/discorb/component/text_input.rbs +1 -0
  111. data/sig/discorb/custom_emoji.rbs +5 -1
  112. data/sig/discorb/dictionary.rbs +2 -0
  113. data/sig/discorb/discord_model.rbs +2 -0
  114. data/sig/discorb/embed.rbs +7 -0
  115. data/sig/discorb/emoji.rbs +1 -0
  116. data/sig/discorb/event_handler.rbs +2 -1
  117. data/sig/discorb/extension.rbs +13 -12
  118. data/sig/discorb/flag.rbs +2 -0
  119. data/sig/discorb/gateway.rbs +5 -0
  120. data/sig/discorb/guild.rbs +8 -4
  121. data/sig/discorb/guild_template.rbs +1 -1
  122. data/sig/discorb/http.rbs +4 -1
  123. data/sig/discorb/image.rbs +2 -0
  124. data/sig/discorb/integration.rbs +1 -1
  125. data/sig/discorb/intents.rbs +4 -3
  126. data/sig/discorb/interaction/base.rbs +36 -0
  127. data/sig/discorb/interaction/message_component.rbs +1 -2
  128. data/sig/discorb/interaction/modal.rbs +1 -2
  129. data/sig/discorb/interaction/responder.rbs +49 -49
  130. data/sig/discorb/invite.rbs +1 -1
  131. data/sig/discorb/member.rbs +2 -0
  132. data/sig/discorb/message.rbs +8 -1
  133. data/sig/discorb/messageable.rbs +1 -4
  134. data/sig/discorb/partial_emoji.rbs +3 -0
  135. data/sig/discorb/permissions.rbs +7 -0
  136. data/sig/discorb/presence.rbs +2 -0
  137. data/sig/discorb/reaction.rbs +5 -1
  138. data/sig/discorb/role.rbs +7 -1
  139. data/sig/discorb/scheduled_event.rbs +2 -1
  140. data/sig/discorb/shard.rbs +2 -1
  141. data/sig/discorb/snowflake.rbs +2 -0
  142. data/sig/discorb/stage_instance.rbs +9 -3
  143. data/sig/discorb/sticker.rbs +1 -1
  144. data/sig/discorb/unicode_emoji.rbs +4 -0
  145. data/sig/discorb/user.rbs +24 -20
  146. data/sig/discorb/webhook.rbs +17 -6
  147. data/sig/discorb/welcome_screen.rbs +1 -0
  148. data/sig/override.rbs +2 -0
  149. metadata +3 -3
@@ -12,12 +12,45 @@ module Discorb
12
12
  # @param [Hash] data The data of the interaction.
13
13
  def initialize: (Discorb::Client client, Discorb::json data) -> void
14
14
 
15
+ %a{pure}
15
16
  def guild: -> Discorb::Guild?
16
17
 
18
+ %a{pure}
17
19
  def channel: -> Discorb::Channel
18
20
 
21
+ %a{pure}
19
22
  def inspect: -> String
20
23
 
24
+ #
25
+ # Edit the original response message.
26
+ # @async
27
+ # @macro edit
28
+ #
29
+ # @param [String] content The new content of the message.
30
+ # @param [Discorb::Embed] embed The new embed of the message.
31
+ # @param [Array<Discorb::Embed>] embeds The new embeds of the message.
32
+ # @param [Array<Discorb::Attachment>] attachments The attachments to remain.
33
+ # @param [Discorb::Attachment] file The file to send.
34
+ # @param [Array<Discorb::Attachment>] files The files to send.
35
+ #
36
+ # @return [Async::Task<void>] The task.
37
+ def edit_original_message: (
38
+ ?String? content,
39
+ ?embed: Discorb::Embed?,
40
+ ?embeds: ::Array[Discorb::Embed]?,
41
+ ?attachment: Discorb::Attachment?,
42
+ ?attachments: ::Array[Discorb::Attachment]?,
43
+ ?components: (::Array[Discorb::Component]
44
+ | ::Array[::Array[Discorb::Component]])?
45
+ ) -> Async::Task[void]
46
+
47
+ #
48
+ # Delete the original response message.
49
+ # @async
50
+ #
51
+ # @return [Async::Task<void>] The task.
52
+ def delete_original_message: -> Async::Task[void]
53
+
21
54
  #
22
55
  # Create a new Interaction instance from the data.
23
56
  # @private
@@ -62,5 +95,8 @@ module Discorb
62
95
  # @return [Symbol] The locale of the guild that created the interaction.
63
96
  # @note This modifies the language code, `-` will be replaced with `_`.
64
97
  attr_reader guild_locale: Symbol
98
+
99
+ # @return [Discorb::Permission] The permissions of the bot.
100
+ attr_reader app_permissions: Discorb::Permission
65
101
  end
66
102
  end
@@ -107,8 +107,7 @@ module Discorb
107
107
  ?components: (::Array[Discorb::Component]
108
108
  | ::Array[::Array[Discorb::Component]])?,
109
109
  ?ephemeral: bool
110
- ) -> (Discorb::Interaction::SourceResponder::CallbackMessage
111
- | Discorb::Webhook::Message)
110
+ ) -> (Discorb::Interaction::CallbackMessage | Discorb::Webhook::Message)
112
111
 
113
112
  # @return [String] The content of the response.
114
113
  attr_reader custom_id: String
@@ -38,8 +38,7 @@ module Discorb
38
38
  ?components: (::Array[Discorb::Component]
39
39
  | ::Array[::Array[Discorb::Component]])?,
40
40
  ?ephemeral: bool
41
- ) -> (Discorb::Interaction::SourceResponder::CallbackMessage
42
- | Discorb::Webhook::Message)
41
+ ) -> (Discorb::Interaction::CallbackMessage | Discorb::Webhook::Message)
43
42
 
44
43
  # @return [String] The custom id of the modal.
45
44
  attr_reader custom_id: String
@@ -41,59 +41,59 @@ module Discorb
41
41
  ?components: (::Array[Discorb::Component]
42
42
  | ::Array[::Array[Discorb::Component]])?,
43
43
  ?ephemeral: bool
44
- ) -> (Discorb::Interaction::SourceResponder::CallbackMessage
45
- | Discorb::Webhook::Message)
44
+ ) -> (Discorb::Interaction::CallbackMessage | Discorb::Webhook::Message)
45
+ end
46
46
 
47
- #
48
- # Represents of a callback message of interaction.
49
- class CallbackMessage
50
- #
51
- # Initializes a new instance of CallbackMessage.
52
- # @private
53
- #
54
- # @param [Client] client The client.
55
- # @param [Hash] data The payload.
56
- # @param [String] application_id The application ID.
57
- # @param [String] token The token.
58
- def initialize: (
59
- Client client,
60
- Discorb::json data,
61
- String application_id,
62
- String token
63
- ) -> void
47
+ #
48
+ # Represents of a callback message of interaction.
49
+ class CallbackMessage
50
+ #
51
+ # Initializes a new instance of CallbackMessage.
52
+ # @private
53
+ #
54
+ # @param [Client] client The client.
55
+ # @param [Hash] data The payload.
56
+ # @param [String] application_id The application ID.
57
+ # @param [String] token The token.
58
+ def initialize: (
59
+ Client client,
60
+ Discorb::json data,
61
+ String application_id,
62
+ String token
63
+ ) -> void
64
64
 
65
- #
66
- # Edits the callback message.
67
- # @async
68
- # @macro edit
69
- #
70
- # @param [String] content The new content of the message.
71
- # @param [Discorb::Embed] embed The new embed of the message.
72
- # @param [Array<Discorb::Embed>] embeds The new embeds of the message.
73
- # @param [Array<Discorb::Attachment>] attachments The attachments to remain.
74
- # @param [Discorb::Attachment] file The file to send.
75
- # @param [Array<Discorb::Attachment>] files The files to send.
76
- #
77
- # @return [Async::Task<void>] The task.
78
- def edit: (
79
- ?String content,
80
- ?embed: Discorb::Embed,
81
- ?embeds: ::Array[Discorb::Embed],
82
- ?file: Discorb::Attachment,
83
- ?files: ::Array[Discorb::Attachment],
84
- ?attachments: ::Array[Discorb::Attachment]
85
- ) -> Async::Task[void]
65
+ #
66
+ # Edits the callback message.
67
+ # @async
68
+ # @macro edit
69
+ #
70
+ # @param [String] content The new content of the message.
71
+ # @param [Discorb::Embed] embed The new embed of the message.
72
+ # @param [Array<Discorb::Embed>] embeds The new embeds of the message.
73
+ # @param [Array<Discorb::Attachment>] attachments The attachments to remain.
74
+ # @param [Discorb::Attachment] file The file to send.
75
+ # @param [Array<Discorb::Attachment>] files The files to send.
76
+ #
77
+ # @return [Async::Task<void>] The task.
78
+ def edit: (
79
+ ?String content,
80
+ ?embed: Discorb::Embed,
81
+ ?embeds: ::Array[Discorb::Embed],
82
+ ?file: Discorb::Attachment,
83
+ ?files: ::Array[Discorb::Attachment],
84
+ ?attachments: ::Array[Discorb::Attachment]
85
+ ) -> Async::Task[void]
86
86
 
87
- #
88
- # Deletes the callback message.
89
- # @async
90
- # @note This will fail if the message is ephemeral.
91
- #
92
- # @return [Async::Task<void>] The task.
93
- def delete!: -> Async::Task[void]
87
+ #
88
+ # Deletes the callback message.
89
+ # @async
90
+ # @note This will fail if the message is ephemeral.
91
+ #
92
+ # @return [Async::Task<void>] The task.
93
+ def delete: -> Async::Task[void]
94
94
 
95
- def inspect: -> String
96
- end
95
+ %a{pure}
96
+ def inspect: -> String
97
97
  end
98
98
 
99
99
  #
@@ -20,7 +20,7 @@ module Discorb
20
20
  # Delete the invite.
21
21
  # @async
22
22
  # @return [Async::Task<void>] The task.
23
- def delete!: (?reason: String) -> Async::Task[void]
23
+ def delete: (?reason: String?) -> Async::Task[void]
24
24
 
25
25
  # @return [String] The code of invite.
26
26
  attr_reader code: String
@@ -21,8 +21,10 @@ module Discorb
21
21
  # Format the member to `Username#Discriminator` style.
22
22
  #
23
23
  # @return [String] The formatted member.
24
+ %a{pure}
24
25
  def to_s: -> String
25
26
 
27
+ %a{pure}
26
28
  def inspect: -> String
27
29
 
28
30
  #
@@ -68,7 +68,7 @@ module Discorb
68
68
  # @param [String] reason The reason for deleting the message.
69
69
  #
70
70
  # @return [Async::Task<void>] The task.
71
- def delete!: (?reason: String?) -> Async::Task[void]
71
+ def delete: (?reason: String?) -> Async::Task[void]
72
72
 
73
73
  #
74
74
  # Convert the message to reference object.
@@ -171,6 +171,7 @@ module Discorb
171
171
  ) -> Async::Task[Discorb::ThreadChannel]
172
172
 
173
173
  # Meta
174
+ %a{pure}
174
175
  def inspect: -> String
175
176
 
176
177
  # @return [Discorb::Snowflake] The ID of the message.
@@ -343,6 +344,7 @@ module Discorb
343
344
  # |`1 << 5`|`:has_thread`|
344
345
  # |`1 << 6`|`:ephemeral`|
345
346
  # |`1 << 7`|`:loading`|
347
+ # |`1 << 8`|`:failed_to_mention_some_roles_in_thread`|
346
348
  class Flag < Discorb::Flag
347
349
  attr_accessor crossposted: bool
348
350
  attr_accessor crosspost: bool
@@ -352,6 +354,7 @@ module Discorb
352
354
  attr_accessor has_thread: bool
353
355
  attr_accessor ephemeral: bool
354
356
  attr_accessor loading: bool
357
+ attr_accessor failed_to_mention_some_roles_in_thread: bool
355
358
  end
356
359
 
357
360
  #
@@ -386,6 +389,7 @@ module Discorb
386
389
  # @see https://discord.com/developers/docs/resources/channel#message-reference-object
387
390
  def self.from_hash: (Discorb::json data) -> Discorb::Message::Reference
388
391
 
392
+ %a{pure}
389
393
  def inspect: -> String
390
394
 
391
395
  # @return [Discorb::Snowflake] The guild ID.
@@ -406,6 +410,7 @@ module Discorb
406
410
  class Sticker
407
411
  def initialize: (untyped data) -> void
408
412
 
413
+ %a{pure}
409
414
  def inspect: -> String
410
415
 
411
416
  # @return [Discorb::Snowflake] The sticker ID.
@@ -429,6 +434,7 @@ module Discorb
429
434
  # @param [Hash] data The interaction data.
430
435
  def initialize: (Discorb::Client client, Discorb::json data) -> void
431
436
 
437
+ %a{pure}
432
438
  def inspect: -> String
433
439
 
434
440
  # @return [Discorb::Snowflake] The interaction ID.
@@ -457,6 +463,7 @@ module Discorb
457
463
  # @param [Hash] data The activity data.
458
464
  def initialize: (Discorb::json data) -> void
459
465
 
466
+ %a{pure}
460
467
  def inspect: -> String
461
468
 
462
469
  # @return [String] The name of activity.
@@ -72,10 +72,7 @@ module Discorb
72
72
  # @param [String] reason The reason for deleting the message.
73
73
  #
74
74
  # @return [Async::Task<void>] The task.
75
- def delete_message!: (
76
- _ToS message_id,
77
- ?reason: String?
78
- ) -> Async::Task[void]
75
+ def delete_message: (_ToS message_id, ?reason: String?) -> Async::Task[void]
79
76
 
80
77
  #
81
78
  # Fetch a message from ID.
@@ -13,14 +13,17 @@ module Discorb
13
13
  # Format the emoji for URI.
14
14
  #
15
15
  # @return [String] the formatted emoji.
16
+ %a{pure}
16
17
  def to_uri: -> String
17
18
 
19
+ %a{pure}
18
20
  def inspect: -> String
19
21
 
20
22
  #
21
23
  # Format the emoji for sending.
22
24
  #
23
25
  # @return [String] the formatted emoji.
26
+ %a{pure}
24
27
  def to_s: -> String
25
28
 
26
29
  # @return [Discorb::Snowflake] The ID of the emoji.
@@ -91,20 +91,26 @@ module Discorb
91
91
  # @param deny [Integer] The denied permissions.
92
92
  def initialize: (Integer allow, Integer deny) -> void
93
93
 
94
+ %a{pure}
94
95
  def allow: -> Discorb::Permission
95
96
 
97
+ %a{pure}
96
98
  def deny: -> Discorb::Permission
97
99
 
100
+ %a{pure}
98
101
  def allow_value: -> Integer
99
102
 
103
+ %a{pure}
100
104
  def deny_value: -> Integer
101
105
 
106
+ %a{pure}
102
107
  def inspect: -> String
103
108
 
104
109
  #
105
110
  # Converts the permission overwrite to a hash.
106
111
  #
107
112
  # @return [Hash] The permission overwrite as a hash.
113
+ %a{pure}
108
114
  def to_hash: -> Hash[Symbol, bool]
109
115
 
110
116
  #
@@ -121,6 +127,7 @@ module Discorb
121
127
  # @param [Symbol] field The field to check.
122
128
  #
123
129
  # @return [true, false, nil] Whether the field is allowed, denied or not set.
130
+ %a{pure}
124
131
  def []: (Symbol field) -> bool?
125
132
 
126
133
  #
@@ -10,6 +10,7 @@ module Discorb
10
10
  # @param [Hash] data The data of the presence.
11
11
  def initialize: (Discorb::Client client, Discorb::json data) -> void
12
12
 
13
+ %a{pure}
13
14
  def inspect: -> String
14
15
 
15
16
  # @return [:online, :idle, :dnd, :offline] The status of the user.
@@ -46,6 +47,7 @@ module Discorb
46
47
  # Convert the activity to a string.
47
48
  #
48
49
  # @return [String] The string representation of the activity.
50
+ %a{pure}
49
51
  def to_s: -> String
50
52
 
51
53
  # @return [String] The name of the activity.
@@ -16,7 +16,11 @@ module Discorb
16
16
  # @param (see Message#fetch_reacted_users)
17
17
  #
18
18
  # @return [Async::Task<Array<Discorb::User>>] The users that reacted with this emoji.
19
- def fetch_users: -> Async::Task[::Array[Discorb::User]]
19
+ def fetch_users: (
20
+ Discorb::emoji emoji,
21
+ ?limit: Integer?,
22
+ ?after: Discorb::Snowflake?
23
+ ) -> Async::Task[::Array[Discorb::User]]
20
24
 
21
25
  # @return [Integer] The number of users that have reacted with this emoji.
22
26
  attr_reader count: Integer
data/sig/discorb/role.rbs CHANGED
@@ -17,6 +17,7 @@ module Discorb
17
17
  Discorb::json data
18
18
  ) -> void
19
19
 
20
+ %a{pure}
20
21
  def icon: -> (Discorb::Asset | Discorb::emoji | nil)
21
22
 
22
23
  #
@@ -31,12 +32,16 @@ module Discorb
31
32
  # Formats the role as a string.
32
33
  #
33
34
  # @return [String] The formatted string.
35
+ %a{pure}
34
36
  def to_s: -> String
35
37
 
38
+ %a{pure}
36
39
  def mention: -> String
37
40
 
41
+ %a{pure}
38
42
  def color?: -> bool
39
43
 
44
+ %a{pure}
40
45
  def inspect: -> String
41
46
 
42
47
  #
@@ -79,8 +84,9 @@ module Discorb
79
84
  # @param [String] reason The reason for deleting the role.
80
85
  #
81
86
  # @return [Async::Task<void>] The task.
82
- def delete!: (?reason: String?) -> Async::Task[void]
87
+ def delete: (?reason: String?) -> Async::Task[void]
83
88
 
89
+ %a{pure}
84
90
  def tag: -> Discorb::Role::Tag
85
91
 
86
92
  # @return [Discorb::Snowflake] The ID of the role.
@@ -57,7 +57,7 @@ module Discorb
57
57
  # @async
58
58
  #
59
59
  # @return [Async::Task<void>] The task.
60
- def delete!: -> Async::Task[void]
60
+ def delete: -> Async::Task[void]
61
61
 
62
62
  #
63
63
  # Fetches the event users.
@@ -139,6 +139,7 @@ module Discorb
139
139
  # @!visibility private
140
140
  def initialize: (untyped data) -> void
141
141
 
142
+ %a{pure}
142
143
  def inspect: -> String
143
144
 
144
145
  # @return [String, nil] The location of the event. Only present if the event is a external event.
@@ -27,8 +27,9 @@ module Discorb
27
27
  # Stops the shard.
28
28
  #
29
29
  # @return [void]
30
- def close!: -> void
30
+ def close: -> void
31
31
 
32
+ %a{pure}
32
33
  def inspect: -> String
33
34
 
34
35
  # @return [Integer] The ID of the shard.
@@ -24,8 +24,10 @@ module Discorb
24
24
  def eql?: (untyped other) -> bool
25
25
 
26
26
  # Return hash of snowflake.
27
+ %a{pure}
27
28
  def hash: -> untyped
28
29
 
30
+ %a{pure}
29
31
  def inspect: -> String
30
32
 
31
33
  # Timestamp of snowflake.
@@ -15,16 +15,22 @@ module Discorb
15
15
  ?no_cache: bool
16
16
  ) -> void
17
17
 
18
- def guild: -> untyped
18
+ %a{pure}
19
+ def guild: -> Discorb::Guild
19
20
 
20
- def channel: -> untyped
21
+ %a{pure}
22
+ def channel: -> Discorb::StageChannel
21
23
 
24
+ %a{pure}
22
25
  def discoverable?: -> bool
23
26
 
27
+ %a{pure}
24
28
  def public?: -> bool
25
29
 
30
+ %a{pure}
26
31
  def guild_only?: -> bool
27
32
 
33
+ %a{pure}
28
34
  def inspect: -> String
29
35
 
30
36
  #
@@ -49,7 +55,7 @@ module Discorb
49
55
  # @param [String] reason The reason for deleting the stage instance.
50
56
  #
51
57
  # @return [Async::Task<void>] The task.
52
- def delete!: (?reason: String?) -> Async::Task[void]
58
+ def delete: (?reason: String?) -> Async::Task[void]
53
59
 
54
60
  # @return [Discorb::Snowflake] The ID of the guild this voice state is for.
55
61
  attr_reader id: Discorb::Snowflake
@@ -75,7 +75,7 @@ module Discorb
75
75
  # @async
76
76
  #
77
77
  # @param [String] reason The reason for the deletion.
78
- def delete!: (?reason: String?) -> untyped
78
+ def delete: (?reason: String?) -> untyped
79
79
 
80
80
  # @!attribute [r] guild
81
81
  # @macro client_cache
@@ -10,14 +10,17 @@ module Discorb
10
10
  def initialize: (String name, ?tone: Integer) -> void
11
11
 
12
12
  # @return [String] The unicode string of the emoji.
13
+ %a{pure}
13
14
  def to_s: -> String
14
15
 
15
16
  #
16
17
  # Format the emoji for URI.
17
18
  #
18
19
  # @return [String] the formatted emoji.
20
+ %a{pure}
19
21
  def to_uri: -> String
20
22
 
23
+ %a{pure}
21
24
  def inspect: -> String
22
25
 
23
26
  #
@@ -25,6 +28,7 @@ module Discorb
25
28
  # @private
26
29
  #
27
30
  # @return [Hash] The hash represents the object.
31
+ %a{pure}
28
32
  def to_hash: -> Discorb::json
29
33
 
30
34
  # @return [String] The name of the emoji. (e.g. :grinning:)
data/sig/discorb/user.rbs CHANGED
@@ -16,8 +16,10 @@ module Discorb
16
16
  # Format the user as `Username#Discriminator` style.
17
17
  #
18
18
  # @return [String] The formatted username.
19
+ %a{pure}
19
20
  def to_s: -> String
20
21
 
22
+ %a{pure}
21
23
  def inspect: -> String
22
24
 
23
25
  #
@@ -61,33 +63,35 @@ module Discorb
61
63
  #
62
64
  # Represents the user's flags.
63
65
  # ## Flag fields
64
- # |`1 << 0`|`:discord_employee`|
65
- # |`1 << 1`|`:partnered_server_owner`|
66
- # |`1 << 2`|`:hypesquad_events`|
66
+ # |`1 << 0`|`:staff`|
67
+ # |`1 << 1`|`:partner`|
68
+ # |`1 << 2`|`:hypesquad`|
67
69
  # |`1 << 3`|`:bug_hunter_level_1`|
68
- # |`1 << 6`|`:house_bravery`|
69
- # |`1 << 7`|`:house_brilliance`|
70
- # |`1 << 8`|`:house_balance`|
71
- # |`1 << 9`|`:early_supporter`|
72
- # |`1 << 10`|`:team_user`|
70
+ # |`1 << 6`|`:hypesquad_online_house_1`|
71
+ # |`1 << 7`|`:hypesquad_online_house_2`|
72
+ # |`1 << 8`|`:hypesquad_online_house_3`|
73
+ # |`1 << 9`|`:premium_early_supporter`|
74
+ # |`1 << 10`|`:team_psuedo_user`|
73
75
  # |`1 << 14`|`:bug_hunter_level_2`|
74
76
  # |`1 << 16`|`:verified_bot`|
75
- # |`1 << 17`|`:early_verified_bot_developer`|
76
- # |`1 << 18`|`:discord_certified_moderator`|
77
+ # |`1 << 17`|`:verified_developer`|
78
+ # |`1 << 18`|`:certified_moderator`|
79
+ # |`1 << 19`|`:bot_http_interactions`|
77
80
  class Flag < Discorb::Flag
78
- attr_accessor discord_employee: bool
79
- attr_accessor partnered_server_owner: bool
80
- attr_accessor hypesquad_events: bool
81
+ attr_accessor staff: bool
82
+ attr_accessor partner: bool
83
+ attr_accessor hypesquad: bool
81
84
  attr_accessor bug_hunter_level_1: bool
82
- attr_accessor house_bravery: bool
83
- attr_accessor house_brilliance: bool
84
- attr_accessor house_balance: bool
85
- attr_accessor early_supporter: bool
86
- attr_accessor team_user: bool
85
+ attr_accessor hypesquad_online_house_1: bool
86
+ attr_accessor hypesquad_online_house_2: bool
87
+ attr_accessor hypesquad_online_house_3: bool
88
+ attr_accessor premium_early_supporter: bool
89
+ attr_accessor team_psuedo_user: bool
87
90
  attr_accessor bug_hunter_level_2: bool
88
91
  attr_accessor verified_bot: bool
89
- attr_accessor early_verified_bot_developer: bool
90
- attr_accessor discord_certified_moderato: bool
92
+ attr_accessor verified_developer: bool
93
+ attr_accessor certified_moderator: bool
94
+ attr_accessor bot_http_interactions: bool
91
95
  end
92
96
  end
93
97
  end
@@ -11,6 +11,7 @@ module Discorb
11
11
  # @param [Hash] data The data of the webhook.
12
12
  def initialize: (Discorb::Client client, Discorb::json data) -> void
13
13
 
14
+ %a{pure}
14
15
  def inspect: -> String
15
16
 
16
17
  #
@@ -64,7 +65,7 @@ module Discorb
64
65
  # @async
65
66
  #
66
67
  # @return [Async::Task<void>] The task.
67
- def delete!: -> Async::Task[void]
68
+ def delete: -> Async::Task[void]
68
69
 
69
70
  #
70
71
  # Edits the webhook's message.
@@ -98,9 +99,7 @@ module Discorb
98
99
  # @param [Discorb::Webhook::Message] message The message to delete.
99
100
  #
100
101
  # @return [Async::Task<void>] The task.
101
- def delete_message!: (
102
- Discorb::Webhook::Message message
103
- ) -> Async::Task[void]
102
+ def delete_message: (Discorb::Webhook::Message message) -> Async::Task[void]
104
103
 
105
104
  #
106
105
  # Creates URLWebhook.
@@ -209,6 +208,7 @@ module Discorb
209
208
  # @param [Hash] data The data of the guild.
210
209
  def initialize: (Discorb::json data) -> void
211
210
 
211
+ %a{pure}
212
212
  def inspect: -> String
213
213
 
214
214
  # @return [Discorb::Snowflake] The ID of the guild.
@@ -231,6 +231,7 @@ module Discorb
231
231
  # @param [Hash] data The data of the channel.
232
232
  def initialize: (Discorb::json data) -> void
233
233
 
234
+ %a{pure}
234
235
  def inspect: -> String
235
236
 
236
237
  # @return [Discorb::Snowflake] The ID of the channel.
@@ -272,14 +273,22 @@ module Discorb
272
273
  # @param (see Webhook#edit_message)
273
274
  #
274
275
  # @return [Async::Task<void>] The task.
275
- def edit: -> Async::Task[void]
276
+ def edit: (
277
+ ?String content,
278
+ ?embed: Discorb::Embed,
279
+ ?embeds: ::Array[Discorb::Embed],
280
+ ?file: Discorb::Attachment,
281
+ ?files: ::Array[Discorb::Attachment],
282
+ ?attachments: ::Array[Discorb::Attachment],
283
+ ?allowed_mentions: Discorb::AllowedMentions
284
+ ) -> Async::Task[void]
276
285
 
277
286
  #
278
287
  # Deletes the message.
279
288
  # @async
280
289
  #
281
290
  # @return [Async::Task<void>] The task.
282
- def delete!: -> Async::Task[void]
291
+ def delete: -> Async::Task[void]
283
292
 
284
293
  # @return [Discorb::Snowflake] The ID of the channel.
285
294
  attr_reader channel_id: Discorb::Snowflake
@@ -301,8 +310,10 @@ module Discorb
301
310
  # Format author with `Name#Discriminator` style.
302
311
  #
303
312
  # @return [String] Formatted author.
313
+ %a{pure}
304
314
  def to_s: -> String
305
315
 
316
+ %a{pure}
306
317
  def inspect: -> String
307
318
 
308
319
  # @return [Boolean] Whether the author is a bot.
@@ -44,6 +44,7 @@ module Discorb
44
44
  #
45
45
  # @return [Hash] The hash.
46
46
  # @see https://discord.com/developers/docs/resources/guild#welcome-screen-object
47
+ %a{pure}
47
48
  def to_hash: -> Discorb::json
48
49
 
49
50
  #