discorb 0.9.3 → 0.9.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/build_main.yml +2 -0
  3. data/Changelog.md +8 -1
  4. data/README.md +6 -6
  5. data/Rakefile +4 -1
  6. data/assets/banner.svg +101 -101
  7. data/docs/cli/run.md +3 -3
  8. data/lib/discorb/app_command.rb +8 -8
  9. data/lib/discorb/application.rb +3 -3
  10. data/lib/discorb/asset.rb +2 -2
  11. data/lib/discorb/audit_logs.rb +7 -7
  12. data/lib/discorb/channel.rb +10 -10
  13. data/lib/discorb/common.rb +3 -3
  14. data/lib/discorb/components.rb +2 -2
  15. data/lib/discorb/embed.rb +2 -2
  16. data/lib/discorb/emoji.rb +3 -3
  17. data/lib/discorb/error.rb +2 -2
  18. data/lib/discorb/exe/init.rb +8 -8
  19. data/lib/discorb/exe/run.rb +1 -1
  20. data/lib/discorb/extension.rb +1 -1
  21. data/lib/discorb/file.rb +1 -1
  22. data/lib/discorb/gateway.rb +8 -8
  23. data/lib/discorb/gateway_requests.rb +1 -1
  24. data/lib/discorb/guild.rb +7 -7
  25. data/lib/discorb/guild_template.rb +4 -4
  26. data/lib/discorb/http.rb +1 -1
  27. data/lib/discorb/integration.rb +3 -3
  28. data/lib/discorb/interaction.rb +13 -13
  29. data/lib/discorb/invite.rb +2 -2
  30. data/lib/discorb/log.rb +1 -1
  31. data/lib/discorb/member.rb +1 -1
  32. data/lib/discorb/message.rb +30 -6
  33. data/lib/discorb/modules.rb +10 -8
  34. data/lib/discorb/permission.rb +2 -2
  35. data/lib/discorb/presence.rb +8 -8
  36. data/lib/discorb/rate_limit.rb +1 -1
  37. data/lib/discorb/reaction.rb +1 -1
  38. data/lib/discorb/role.rb +2 -2
  39. data/lib/discorb/sticker.rb +3 -3
  40. data/lib/discorb/user.rb +2 -2
  41. data/lib/discorb/utils/colored_puts.rb +3 -3
  42. data/lib/discorb/utils.rb +1 -1
  43. data/lib/discorb/voice_state.rb +3 -3
  44. data/lib/discorb/webhook.rb +7 -8
  45. data/lib/discorb.rb +1 -1
  46. data/sig/discorb.rbs +2 -2
  47. data/template-replace/files/css/common.css +25 -0
  48. data/template-replace/files/favicon.png +0 -0
  49. data/template-replace/scripts/favicon.rb +9 -0
  50. metadata +4 -2
@@ -16,7 +16,7 @@ module Discorb
16
16
  alias me? me
17
17
  alias reacted? me
18
18
 
19
- # @!visibility private
19
+ # @private
20
20
  def initialize(message, data)
21
21
  @message = message
22
22
  _set_data(data)
data/lib/discorb/role.rb CHANGED
@@ -36,7 +36,7 @@ module Discorb
36
36
 
37
37
  include Comparable
38
38
 
39
- # @!visibility private
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
- # @!visibility private
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])
@@ -38,7 +38,7 @@ module Discorb
38
38
  2 => :apng,
39
39
  3 => :lottie,
40
40
  }
41
- # @!visibility private
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
- # @!visibility private
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
- # @!visibility private
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
- # @!visibility private
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
- # @!visibility private
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
- # @!visibility private
1
+ # @private
2
2
  def sputs(text)
3
3
  puts "\e[92m#{text}\e[m"
4
4
  end
5
5
 
6
- # @!visibility private
6
+ # @private
7
7
  def eputs(text)
8
8
  puts "\e[91m#{text}\e[m"
9
9
  end
10
10
 
11
- # @!visibility private
11
+ # @private
12
12
  def iputs(text)
13
13
  puts "\e[90m#{text}\e[m"
14
14
  end
data/lib/discorb/utils.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Discorb
4
- # @!visibility private
4
+ # @private
5
5
  module Utils
6
6
  def try(object, message, ...)
7
7
  if object.respond_to?(message)
@@ -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
- # @!visibility private
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
- # @!visibility private
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
- # @!visibility private
241
+ # @private
242
242
  def initialize(data)
243
243
  @id = data[:id]
244
244
  @name = data[:name]
@@ -22,7 +22,7 @@ module Discorb
22
22
  # @return [String] The URL of the webhook.
23
23
  attr_reader :token
24
24
 
25
- # @!visibility private
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
- # @!visibility private
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
- # @!visibility private
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
- # @!visibility private
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
- # @!visibility private
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
- # @!visibility private
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
- # @!visibility private
373
+ # @private
375
374
  def initialize(data)
376
375
  @data = data
377
376
  @bot = data[:bot]
data/lib/discorb.rb CHANGED
@@ -4,7 +4,7 @@
4
4
  #
5
5
  # @author sevenc-nanashi
6
6
  module Discorb
7
- # @!visibility private
7
+ # @private
8
8
  # @!macro [new] async
9
9
  # @note This is an asynchronous method, it will return a `Async::Task` object. Use `Async::Task#wait` to get the result.
10
10
  #
data/sig/discorb.rbs CHANGED
@@ -13,7 +13,7 @@ module Discorb
13
13
 
14
14
  def macro: () -> void
15
15
 
16
- # @!visibility private
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
- # @!visibility private
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
@@ -0,0 +1,9 @@
1
+ require "fileutils"
2
+
3
+ def add_favicon(dir)
4
+ Dir.glob("#{dir}/**/*.html").each do |file|
5
+ content = File.read(file)
6
+ content.gsub!(/<head>/, "<head>\n<link rel=\"shortcut icon\" href=\"/favicon.png\" />")
7
+ File.write(file, content)
8
+ end
9
+ end
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.3
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-24 00:00:00.000000000 Z
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