discorb 0.16.0 → 0.17.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (115) hide show
  1. checksums.yaml +4 -4
  2. data/.gitattributes +1 -0
  3. data/.github/workflows/build_main.yml +2 -2
  4. data/.github/workflows/build_version.yml +1 -1
  5. data/.github/workflows/codeql-analysis.yml +1 -1
  6. data/.github/workflows/lint-push.yml +3 -5
  7. data/.github/workflows/lint.yml +1 -1
  8. data/.github/workflows/spec.yml +30 -0
  9. data/.lefthook/commit-msg/validator.rb +5 -0
  10. data/.rspec +2 -0
  11. data/.rspec_parallel +2 -0
  12. data/.rubocop.yml +43 -6
  13. data/Changelog.md +14 -1
  14. data/Gemfile +14 -8
  15. data/Rakefile +41 -26
  16. data/bin/console +3 -3
  17. data/docs/Examples.md +1 -1
  18. data/docs/application_command.md +138 -46
  19. data/docs/cli/irb.md +2 -2
  20. data/docs/cli/new.md +14 -9
  21. data/docs/cli/run.md +7 -11
  22. data/docs/cli.md +17 -10
  23. data/docs/events.md +209 -211
  24. data/docs/extension.md +1 -2
  25. data/docs/faq.md +0 -1
  26. data/docs/tutorial.md +12 -12
  27. data/docs/voice_events.md +106 -106
  28. data/examples/commands/message.rb +63 -0
  29. data/examples/commands/permission.rb +18 -0
  30. data/examples/commands/slash.rb +44 -0
  31. data/examples/commands/user.rb +51 -0
  32. data/examples/components/authorization_button.rb +2 -2
  33. data/examples/components/select_menu.rb +2 -2
  34. data/examples/extension/main.rb +1 -1
  35. data/examples/extension/message_expander.rb +5 -2
  36. data/examples/simple/eval.rb +2 -2
  37. data/examples/simple/ping_pong.rb +1 -1
  38. data/examples/simple/rolepanel.rb +1 -1
  39. data/examples/simple/shard.rb +1 -1
  40. data/examples/simple/wait_for_message.rb +1 -1
  41. data/exe/discorb +31 -16
  42. data/lefthook.yml +45 -0
  43. data/lib/discorb/allowed_mentions.rb +1 -0
  44. data/lib/discorb/app_command/command.rb +127 -65
  45. data/lib/discorb/app_command/common.rb +25 -0
  46. data/lib/discorb/app_command/handler.rb +115 -33
  47. data/lib/discorb/app_command.rb +2 -1
  48. data/lib/discorb/application.rb +1 -0
  49. data/lib/discorb/asset.rb +1 -2
  50. data/lib/discorb/attachment.rb +1 -1
  51. data/lib/discorb/audit_logs.rb +11 -8
  52. data/lib/discorb/channel/base.rb +108 -0
  53. data/lib/discorb/channel/category.rb +32 -0
  54. data/lib/discorb/channel/container.rb +44 -0
  55. data/lib/discorb/channel/dm.rb +28 -0
  56. data/lib/discorb/channel/guild.rb +245 -0
  57. data/lib/discorb/channel/stage.rb +140 -0
  58. data/lib/discorb/channel/text.rb +345 -0
  59. data/lib/discorb/channel/thread.rb +321 -0
  60. data/lib/discorb/channel/voice.rb +79 -0
  61. data/lib/discorb/channel.rb +2 -1165
  62. data/lib/discorb/client.rb +38 -26
  63. data/lib/discorb/common.rb +2 -1
  64. data/lib/discorb/components/button.rb +2 -1
  65. data/lib/discorb/components/select_menu.rb +4 -2
  66. data/lib/discorb/components/text_input.rb +12 -2
  67. data/lib/discorb/components.rb +1 -1
  68. data/lib/discorb/embed.rb +22 -7
  69. data/lib/discorb/emoji.rb +30 -3
  70. data/lib/discorb/emoji_table.rb +4969 -3
  71. data/lib/discorb/event.rb +29 -4
  72. data/lib/discorb/exe/about.rb +1 -0
  73. data/lib/discorb/exe/irb.rb +2 -4
  74. data/lib/discorb/exe/new.rb +90 -23
  75. data/lib/discorb/exe/run.rb +8 -22
  76. data/lib/discorb/exe/setup.rb +25 -12
  77. data/lib/discorb/exe/show.rb +4 -3
  78. data/lib/discorb/extend.rb +1 -0
  79. data/lib/discorb/extension.rb +6 -3
  80. data/lib/discorb/flag.rb +11 -0
  81. data/lib/discorb/gateway.rb +67 -19
  82. data/lib/discorb/guild.rb +188 -56
  83. data/lib/discorb/guild_template.rb +10 -4
  84. data/lib/discorb/http.rb +16 -9
  85. data/lib/discorb/integration.rb +4 -1
  86. data/lib/discorb/intents.rb +1 -1
  87. data/lib/discorb/interaction/autocomplete.rb +28 -16
  88. data/lib/discorb/interaction/command.rb +36 -12
  89. data/lib/discorb/interaction/components.rb +5 -2
  90. data/lib/discorb/interaction/modal.rb +0 -1
  91. data/lib/discorb/interaction/response.rb +61 -22
  92. data/lib/discorb/interaction/root.rb +13 -13
  93. data/lib/discorb/interaction.rb +1 -0
  94. data/lib/discorb/invite.rb +5 -2
  95. data/lib/discorb/member.rb +25 -5
  96. data/lib/discorb/message.rb +47 -14
  97. data/lib/discorb/message_meta.rb +1 -0
  98. data/lib/discorb/modules.rb +56 -14
  99. data/lib/discorb/presence.rb +2 -2
  100. data/lib/discorb/rate_limit.rb +7 -2
  101. data/lib/discorb/reaction.rb +4 -4
  102. data/lib/discorb/role.rb +19 -4
  103. data/lib/discorb/shard.rb +1 -1
  104. data/lib/discorb/sticker.rb +8 -7
  105. data/lib/discorb/user.rb +2 -1
  106. data/lib/discorb/utils/colored_puts.rb +1 -0
  107. data/lib/discorb/voice_state.rb +10 -6
  108. data/lib/discorb/webhook.rb +36 -24
  109. data/lib/discorb.rb +5 -3
  110. data/po/yard.pot +9 -9
  111. data/sig/discorb.rbs +7232 -7235
  112. metadata +21 -5
  113. data/examples/commands/bookmarker.rb +0 -42
  114. data/examples/commands/hello.rb +0 -10
  115. data/examples/commands/inspect.rb +0 -25
data/po/yard.pot CHANGED
@@ -4519,7 +4519,7 @@ msgid "Command block."
4519
4519
  msgstr ""
4520
4520
 
4521
4521
  # @return [Discorb::ApplicationCommand::Command::GroupCommand]
4522
- # @return [Discorb::ApplicationCommand::Command::SlashCommand]
4522
+ # @return [Discorb::ApplicationCommand::Command::ChatInputCommand]
4523
4523
  # @return [Discorb::ApplicationCommand::Command::SubcommandGroup]
4524
4524
  # @return [Discorb::ApplicationCommand::Command]
4525
4525
  #: ../lib/discorb/app_command.rb:40
@@ -4722,7 +4722,7 @@ msgstr ""
4722
4722
  msgid "a new instance of Command"
4723
4723
  msgstr ""
4724
4724
 
4725
- # Discorb::ApplicationCommand::Command::SlashCommand
4725
+ # Discorb::ApplicationCommand::Command::ChatInputCommand
4726
4726
  #: ../lib/discorb/app_command.rb:194
4727
4727
  msgid "Represents the slash command."
4728
4728
  msgstr ""
@@ -4738,12 +4738,12 @@ msgstr ""
4738
4738
  msgid "The options of the command."
4739
4739
  msgstr ""
4740
4740
 
4741
- # @return [SlashCommand]
4741
+ # @return [ChatInputCommand]
4742
4742
  #: ../lib/discorb/app_command.rb:203
4743
- msgid "a new instance of SlashCommand"
4743
+ msgid "a new instance of ChatInputCommand"
4744
4744
  msgstr ""
4745
4745
 
4746
- # Discorb::ApplicationCommand::Command::SlashCommand#to_s
4746
+ # Discorb::ApplicationCommand::Command::ChatInputCommand#to_s
4747
4747
  #: ../lib/discorb/app_command.rb:213
4748
4748
  msgid "Returns the commands name."
4749
4749
  msgstr ""
@@ -4753,8 +4753,8 @@ msgstr ""
4753
4753
  msgid "Represents the command with subcommands."
4754
4754
  msgstr ""
4755
4755
 
4756
- # @return [Array<Discorb::ApplicationCommand::Command::SlashCommand, Discorb::ApplicationCommand::Command::SubcommandGroup>]
4757
- # @return [Array<Discorb::ApplicationCommand::Command::SlashCommand>]
4756
+ # @return [Array<Discorb::ApplicationCommand::Command::ChatInputCommand, Discorb::ApplicationCommand::Command::SubcommandGroup>]
4757
+ # @return [Array<Discorb::ApplicationCommand::Command::ChatInputCommand>]
4758
4758
  #: ../lib/discorb/app_command.rb:275
4759
4759
  #: ../lib/discorb/app_command.rb:372
4760
4760
  msgid "The subcommands of the command."
@@ -4772,7 +4772,7 @@ msgstr ""
4772
4772
  msgid "Add new subcommand."
4773
4773
  msgstr ""
4774
4774
 
4775
- # @return [Discorb::ApplicationCommand::Command::SlashCommand]
4775
+ # @return [Discorb::ApplicationCommand::Command::ChatInputCommand]
4776
4776
  #: ../lib/discorb/app_command.rb:294
4777
4777
  #: ../lib/discorb/app_command.rb:391
4778
4778
  msgid "The added subcommand."
@@ -12122,7 +12122,7 @@ msgstr ""
12122
12122
  msgid "Represents a command interaction."
12123
12123
  msgstr ""
12124
12124
 
12125
- # Discorb::CommandInteraction::SlashCommand
12125
+ # Discorb::CommandInteraction::ChatInputCommand
12126
12126
  #: ../lib/discorb/interaction/command.rb:11
12127
12127
  msgid "Represents a slash command interaction."
12128
12128
  msgstr ""