discorb 0.9.3 → 0.9.4
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/.github/workflows/build_main.yml +2 -0
- data/Changelog.md +8 -1
- data/README.md +6 -6
- data/Rakefile +4 -1
- data/assets/banner.svg +101 -101
- data/docs/cli/run.md +3 -3
- data/lib/discorb/app_command.rb +8 -8
- data/lib/discorb/application.rb +3 -3
- data/lib/discorb/asset.rb +2 -2
- data/lib/discorb/audit_logs.rb +7 -7
- data/lib/discorb/channel.rb +10 -10
- data/lib/discorb/common.rb +3 -3
- data/lib/discorb/components.rb +2 -2
- data/lib/discorb/embed.rb +2 -2
- data/lib/discorb/emoji.rb +3 -3
- data/lib/discorb/error.rb +2 -2
- data/lib/discorb/exe/init.rb +8 -8
- data/lib/discorb/exe/run.rb +1 -1
- data/lib/discorb/extension.rb +1 -1
- data/lib/discorb/file.rb +1 -1
- data/lib/discorb/gateway.rb +8 -8
- data/lib/discorb/gateway_requests.rb +1 -1
- data/lib/discorb/guild.rb +7 -7
- data/lib/discorb/guild_template.rb +4 -4
- data/lib/discorb/http.rb +1 -1
- data/lib/discorb/integration.rb +3 -3
- data/lib/discorb/interaction.rb +13 -13
- data/lib/discorb/invite.rb +2 -2
- data/lib/discorb/log.rb +1 -1
- data/lib/discorb/member.rb +1 -1
- data/lib/discorb/message.rb +30 -6
- data/lib/discorb/modules.rb +10 -8
- data/lib/discorb/permission.rb +2 -2
- data/lib/discorb/presence.rb +8 -8
- data/lib/discorb/rate_limit.rb +1 -1
- data/lib/discorb/reaction.rb +1 -1
- data/lib/discorb/role.rb +2 -2
- data/lib/discorb/sticker.rb +3 -3
- data/lib/discorb/user.rb +2 -2
- data/lib/discorb/utils/colored_puts.rb +3 -3
- data/lib/discorb/utils.rb +1 -1
- data/lib/discorb/voice_state.rb +3 -3
- data/lib/discorb/webhook.rb +7 -8
- data/lib/discorb.rb +1 -1
- data/sig/discorb.rbs +2 -2
- data/template-replace/files/css/common.css +25 -0
- data/template-replace/files/favicon.png +0 -0
- data/template-replace/scripts/favicon.rb +9 -0
- metadata +4 -2
data/lib/discorb/reaction.rb
CHANGED
data/lib/discorb/role.rb
CHANGED
@@ -36,7 +36,7 @@ module Discorb
|
|
36
36
|
|
37
37
|
include Comparable
|
38
38
|
|
39
|
-
#
|
39
|
+
# @private
|
40
40
|
def initialize(client, guild, data)
|
41
41
|
@client = client
|
42
42
|
@guild = guild
|
@@ -154,7 +154,7 @@ module Discorb
|
|
154
154
|
# @!attribute [r] integration?
|
155
155
|
# @return [Boolean] Whether the role is an integration role.
|
156
156
|
|
157
|
-
#
|
157
|
+
# @private
|
158
158
|
def initialize(data)
|
159
159
|
@bot_id = Snowflake.new(data[:bot_id])
|
160
160
|
@integration_id = Snowflake.new(data[:integration_id])
|
data/lib/discorb/sticker.rb
CHANGED
@@ -38,7 +38,7 @@ module Discorb
|
|
38
38
|
2 => :apng,
|
39
39
|
3 => :lottie,
|
40
40
|
}
|
41
|
-
#
|
41
|
+
# @private
|
42
42
|
def initialize(client, data)
|
43
43
|
@client = client
|
44
44
|
_set_data(data)
|
@@ -116,7 +116,7 @@ module Discorb
|
|
116
116
|
# @return [Discorb::Asset] The banner of the pack.
|
117
117
|
attr_reader :banner
|
118
118
|
|
119
|
-
#
|
119
|
+
# @private
|
120
120
|
def initialize(client, data)
|
121
121
|
@client = client
|
122
122
|
@id = Snowflake.new(data[:id])
|
@@ -150,7 +150,7 @@ module Discorb
|
|
150
150
|
end
|
151
151
|
|
152
152
|
class << self
|
153
|
-
#
|
153
|
+
# @private
|
154
154
|
attr_reader :sticker_type, :sticker_format
|
155
155
|
end
|
156
156
|
end
|
data/lib/discorb/user.rb
CHANGED
@@ -26,7 +26,7 @@ module Discorb
|
|
26
26
|
|
27
27
|
include Discorb::Messageable
|
28
28
|
|
29
|
-
#
|
29
|
+
# @private
|
30
30
|
def initialize(client, data)
|
31
31
|
@client = client
|
32
32
|
@data = {}
|
@@ -73,7 +73,7 @@ module Discorb
|
|
73
73
|
|
74
74
|
alias app_owner? bot_owner?
|
75
75
|
|
76
|
-
#
|
76
|
+
# @private
|
77
77
|
def channel_id
|
78
78
|
Async do
|
79
79
|
next @dm_channel_id if @dm_channel_id
|
@@ -1,14 +1,14 @@
|
|
1
|
-
#
|
1
|
+
# @private
|
2
2
|
def sputs(text)
|
3
3
|
puts "\e[92m#{text}\e[m"
|
4
4
|
end
|
5
5
|
|
6
|
-
#
|
6
|
+
# @private
|
7
7
|
def eputs(text)
|
8
8
|
puts "\e[91m#{text}\e[m"
|
9
9
|
end
|
10
10
|
|
11
|
-
#
|
11
|
+
# @private
|
12
12
|
def iputs(text)
|
13
13
|
puts "\e[90m#{text}\e[m"
|
14
14
|
end
|
data/lib/discorb/utils.rb
CHANGED
data/lib/discorb/voice_state.rb
CHANGED
@@ -43,7 +43,7 @@ module Discorb
|
|
43
43
|
# @macro client_cache
|
44
44
|
# @return [Discorb::User] The user this voice state is for.
|
45
45
|
|
46
|
-
#
|
46
|
+
# @private
|
47
47
|
def initialize(client, data)
|
48
48
|
@client = client
|
49
49
|
_set_data(data)
|
@@ -132,7 +132,7 @@ module Discorb
|
|
132
132
|
2 => :guild_only,
|
133
133
|
}
|
134
134
|
|
135
|
-
#
|
135
|
+
# @private
|
136
136
|
def initialize(client, data, no_cache: false)
|
137
137
|
@client = client
|
138
138
|
@data = data
|
@@ -238,7 +238,7 @@ module Discorb
|
|
238
238
|
attr_reader :custom
|
239
239
|
alias custom? custom
|
240
240
|
|
241
|
-
#
|
241
|
+
# @private
|
242
242
|
def initialize(data)
|
243
243
|
@id = data[:id]
|
244
244
|
@name = data[:name]
|
data/lib/discorb/webhook.rb
CHANGED
@@ -22,7 +22,7 @@ module Discorb
|
|
22
22
|
# @return [String] The URL of the webhook.
|
23
23
|
attr_reader :token
|
24
24
|
|
25
|
-
#
|
25
|
+
# @private
|
26
26
|
def initialize(client, data)
|
27
27
|
@name = data[:name]
|
28
28
|
@guild_id = data[:guild_id] && Snowflake.new(data[:guild_id])
|
@@ -154,7 +154,6 @@ module Discorb
|
|
154
154
|
payload[:content] = content if content != :unset
|
155
155
|
payload[:embeds] = embed ? [embed.to_hash] : [] if embed != :unset
|
156
156
|
payload[:embeds] = embeds.map(&:to_hash) if embeds != :unset
|
157
|
-
attachments = [attachment] if attachment != :unset
|
158
157
|
payload[:attachments] = attachments.map(&:to_hash) if attachments != :unset
|
159
158
|
payload[:allowed_mentions] = allowed_mentions if allowed_mentions != :unset
|
160
159
|
files = [file] if file != :unset
|
@@ -209,7 +208,7 @@ module Discorb
|
|
209
208
|
# @!attribute [r] url
|
210
209
|
# @return [String] The URL of the webhook.
|
211
210
|
|
212
|
-
#
|
211
|
+
# @private
|
213
212
|
def initialize(client, data)
|
214
213
|
super
|
215
214
|
@token = data[:token]
|
@@ -231,7 +230,7 @@ module Discorb
|
|
231
230
|
# Represents a source channel of follower webhook.
|
232
231
|
# @return [Discorb::Channel, Discorb::Webhook::FollowerWebhook::Channel] The source channel of follower webhook.
|
233
232
|
|
234
|
-
#
|
233
|
+
# @private
|
235
234
|
def initialize(client, data)
|
236
235
|
super
|
237
236
|
@source_guild = FollowerWebhook::Guild.new(data[:source_guild])
|
@@ -257,7 +256,7 @@ module Discorb
|
|
257
256
|
# @return [Discorb::Asset] The icon of the guild.
|
258
257
|
attr_reader :icon
|
259
258
|
|
260
|
-
#
|
259
|
+
# @private
|
261
260
|
def initialize(data)
|
262
261
|
@id = Snowflake.new(data[:id])
|
263
262
|
@name = data[:name]
|
@@ -274,7 +273,7 @@ module Discorb
|
|
274
273
|
# @return [String] The name of the channel.
|
275
274
|
attr_reader :name
|
276
275
|
|
277
|
-
#
|
276
|
+
# @private
|
278
277
|
def initialize(data)
|
279
278
|
@id = Snowflake.new(data[:id])
|
280
279
|
@name = data[:name]
|
@@ -299,7 +298,7 @@ module Discorb
|
|
299
298
|
# @return [Discorb::Snowflake] The ID of the guild.
|
300
299
|
attr_reader :guild_id
|
301
300
|
|
302
|
-
#
|
301
|
+
# @private
|
303
302
|
def initialize(webhook, data, client = nil)
|
304
303
|
@client = client
|
305
304
|
@webhook = webhook
|
@@ -371,7 +370,7 @@ module Discorb
|
|
371
370
|
# @return [String] The discriminator of the author.
|
372
371
|
attr_reader :discriminator
|
373
372
|
|
374
|
-
#
|
373
|
+
# @private
|
375
374
|
def initialize(data)
|
376
375
|
@data = data
|
377
376
|
@bot = data[:bot]
|
data/lib/discorb.rb
CHANGED
data/sig/discorb.rbs
CHANGED
@@ -13,7 +13,7 @@ module Discorb
|
|
13
13
|
|
14
14
|
def macro: () -> void
|
15
15
|
|
16
|
-
#
|
16
|
+
# @private
|
17
17
|
class Logger
|
18
18
|
def initialize: (untyped _out, untyped colorize_log, untyped level) -> void
|
19
19
|
|
@@ -2132,7 +2132,7 @@ module Discorb
|
|
2132
2132
|
def to_s: () -> String
|
2133
2133
|
end
|
2134
2134
|
|
2135
|
-
#
|
2135
|
+
# @private
|
2136
2136
|
module Utils
|
2137
2137
|
def try: (untyped object, untyped message) -> untyped
|
2138
2138
|
|
@@ -527,4 +527,29 @@ dd pre.code {
|
|
527
527
|
padding: 9px 14px;
|
528
528
|
border-radius: 4px;
|
529
529
|
border: 1px solid var(--background-tertiary);
|
530
|
+
}
|
531
|
+
|
532
|
+
#main {
|
533
|
+
max-width: 100vw;
|
534
|
+
}
|
535
|
+
|
536
|
+
#search input{
|
537
|
+
appearance: none;
|
538
|
+
}
|
539
|
+
|
540
|
+
.fixed_header{
|
541
|
+
padding-bottom: 0;
|
542
|
+
height: 80px;
|
543
|
+
}
|
544
|
+
|
545
|
+
#full_list_header{
|
546
|
+
font-size: 1.2em;
|
547
|
+
}
|
548
|
+
|
549
|
+
#search{
|
550
|
+
display: inline !important;
|
551
|
+
}
|
552
|
+
|
553
|
+
p.signature, h3.signature{
|
554
|
+
font-family: var(--font-monospace);
|
530
555
|
}
|
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: discorb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sevenc-nanashi
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-09-
|
11
|
+
date: 2021-09-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: async
|
@@ -179,7 +179,9 @@ files:
|
|
179
179
|
- po/yard.pot
|
180
180
|
- sig/discorb.rbs
|
181
181
|
- template-replace/files/css/common.css
|
182
|
+
- template-replace/files/favicon.png
|
182
183
|
- template-replace/resources/version_list.html
|
184
|
+
- template-replace/scripts/favicon.rb
|
183
185
|
- template-replace/scripts/index.rb
|
184
186
|
- template-replace/scripts/sidebar.rb
|
185
187
|
- template-replace/scripts/version.rb
|