discorb 0.9.0 → 0.9.5

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 (55) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/build_main.yml +2 -0
  3. data/Changelog.md +28 -1
  4. data/README.md +6 -6
  5. data/Rakefile +7 -1
  6. data/assets/banner.svg +101 -101
  7. data/docs/application_command.md +8 -7
  8. data/docs/cli/run.md +3 -3
  9. data/docs/faq.md +1 -1
  10. data/docs/license.md +1 -1
  11. data/lib/discorb/app_command.rb +12 -10
  12. data/lib/discorb/application.rb +3 -3
  13. data/lib/discorb/asset.rb +2 -2
  14. data/lib/discorb/audit_logs.rb +7 -7
  15. data/lib/discorb/channel.rb +10 -10
  16. data/lib/discorb/common.rb +3 -3
  17. data/lib/discorb/components.rb +2 -2
  18. data/lib/discorb/embed.rb +2 -2
  19. data/lib/discorb/emoji.rb +3 -3
  20. data/lib/discorb/error.rb +2 -2
  21. data/lib/discorb/exe/init.rb +8 -8
  22. data/lib/discorb/exe/run.rb +1 -1
  23. data/lib/discorb/extend.rb +21 -0
  24. data/lib/discorb/extension.rb +1 -1
  25. data/lib/discorb/file.rb +19 -1
  26. data/lib/discorb/gateway.rb +10 -12
  27. data/lib/discorb/gateway_requests.rb +1 -1
  28. data/lib/discorb/guild.rb +7 -7
  29. data/lib/discorb/guild_template.rb +4 -4
  30. data/lib/discorb/http.rb +1 -1
  31. data/lib/discorb/integration.rb +3 -3
  32. data/lib/discorb/interaction.rb +104 -35
  33. data/lib/discorb/invite.rb +2 -2
  34. data/lib/discorb/log.rb +1 -1
  35. data/lib/discorb/member.rb +1 -1
  36. data/lib/discorb/message.rb +34 -10
  37. data/lib/discorb/modules.rb +11 -9
  38. data/lib/discorb/permission.rb +2 -2
  39. data/lib/discorb/presence.rb +8 -8
  40. data/lib/discorb/rate_limit.rb +1 -1
  41. data/lib/discorb/reaction.rb +1 -1
  42. data/lib/discorb/role.rb +2 -2
  43. data/lib/discorb/sticker.rb +3 -3
  44. data/lib/discorb/user.rb +2 -2
  45. data/lib/discorb/utils/colored_puts.rb +3 -3
  46. data/lib/discorb/utils.rb +1 -1
  47. data/lib/discorb/voice_state.rb +3 -3
  48. data/lib/discorb/webhook.rb +7 -8
  49. data/lib/discorb.rb +1 -1
  50. data/sig/discorb.rbs +2 -2
  51. data/template-replace/files/css/common.css +25 -0
  52. data/template-replace/files/favicon.png +0 -0
  53. data/template-replace/scripts/arrow.rb +7 -0
  54. data/template-replace/scripts/favicon.rb +9 -0
  55. metadata +5 -2
@@ -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, p.signature tt, h3.signature tt{
554
+ font-family: var(--monospace-font);
530
555
  }
Binary file
@@ -0,0 +1,7 @@
1
+ def replace_arrow(dir)
2
+ Dir.glob("#{dir}/**/*.html") do |file|
3
+ content = File.read(file)
4
+ content.gsub!(" ⇒ ", " -> ")
5
+ File.write(file, content, mode: "wb")
6
+ end
7
+ end
@@ -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.0
4
+ version: 0.9.5
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-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: async
@@ -179,7 +179,10 @@ 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/arrow.rb
185
+ - template-replace/scripts/favicon.rb
183
186
  - template-replace/scripts/index.rb
184
187
  - template-replace/scripts/sidebar.rb
185
188
  - template-replace/scripts/version.rb