discorb 0.9.1 → 0.9.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/build_main.yml +2 -0
- data/Changelog.md +30 -1
- data/README.md +6 -6
- data/Rakefile +7 -1
- data/assets/banner.svg +101 -101
- data/docs/application_command.md +8 -7
- data/docs/cli/run.md +3 -3
- data/docs/faq.md +1 -1
- data/docs/license.md +1 -1
- data/lib/discorb/app_command.rb +12 -10
- 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 +30 -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/extend.rb +21 -0
- data/lib/discorb/extension.rb +1 -1
- data/lib/discorb/file.rb +19 -1
- data/lib/discorb/gateway.rb +9 -11
- 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 +108 -37
- 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 +34 -10
- data/lib/discorb/modules.rb +15 -49
- 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/arrow.rb +7 -0
- data/template-replace/scripts/favicon.rb +9 -0
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 82c013d06e2f831b3d0bac635ca13eeea99fe5b248a04e4879bb5f0a17374b90
|
4
|
+
data.tar.gz: bf9d0ea7d1f84696d03e705edbcf8e78ee80b87ab393a06b6d7c5abee6d7fcb5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '08088483e41f563e1458cef68132c6f0d98c9ff2d99f319ff80dbd4d242b0248567b0e4114d48bd07fcf942179b76ac480217b2bfb82da7a9d957ace5b1ef83c'
|
7
|
+
data.tar.gz: 95995caa4ca9ac2d8a6388660afcf10e0928b59347fb4fc5656324fd0917bf80506c6ceb42545b76196ab988e3d3ad62d9449a15cfa57acad85c02e42cbc9294
|
data/Changelog.md
CHANGED
@@ -234,4 +234,33 @@ end
|
|
234
234
|
|
235
235
|
## 0.9.1
|
236
236
|
|
237
|
-
- Fix: Fix member fetching
|
237
|
+
- Fix: Fix member fetching
|
238
|
+
|
239
|
+
## 0.9.2 (yanked)
|
240
|
+
|
241
|
+
- Add: Make `Async::Task#inspect` shorter
|
242
|
+
- Add: `SourceResponse#post` will return message now
|
243
|
+
- Fix: Fix member caching
|
244
|
+
|
245
|
+
## 0.9.3
|
246
|
+
|
247
|
+
- Fix: Fix interaction responding
|
248
|
+
|
249
|
+
## 0.9.4
|
250
|
+
|
251
|
+
- Change: `Messageable#typing` with block is now synchronous
|
252
|
+
- Fix: Fix some issues in document
|
253
|
+
- Add: Add some attributes to `Message`
|
254
|
+
- Fix: Fix guild parameter in message of message command
|
255
|
+
|
256
|
+
## 0.9.5
|
257
|
+
|
258
|
+
- Fix: Fix editing message
|
259
|
+
- Add: Add `required` in slash command argument
|
260
|
+
- Add: Add `default` in slash command argument
|
261
|
+
|
262
|
+
## 0.9.6
|
263
|
+
|
264
|
+
- Add: Add `Messageable#send_message` as alias of `Messageable#post`
|
265
|
+
- Fix: Fix interaction responding with updating message
|
266
|
+
- Fix: Fix `MessageComponentInteraction#message`
|
data/README.md
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
|
1
|
+
<div align="center"><img src="./assets/banner.svg" alt="discorb"></div>
|
2
2
|
|
3
|
-
<div align="center"><a href="https://discorb-lib.github.io/"><img src="https://img.shields.io/badge/Document-discorb--lib.github.io-blue.svg" alt="Document"></a>
|
4
|
-
<a href="https://rubygems.org/gems/discorb"><img src="https://img.shields.io/gem/dt/discorb?logo=rubygems&logoColor=fff&label=Downloads" alt="Gem"></a>
|
5
|
-
<a href="https://rubygems.org/gems/discorb"><img src="https://img.shields.io/gem/v/discorb?logo=rubygems&logoColor=fff&label=Version" alt="Gem"></a>
|
6
|
-
<a href="https://discord.gg/hCP6zq8Vpj"><img src="https://img.shields.io/discord/863581274916913193?logo=discord&logoColor=fff&color=5865f2&label=Discord" alt="Discord"></a>
|
7
|
-
<a href="https://github.com/discorb-lib/discorb"><img src="https://img.shields.io/github/stars/discorb-lib/discorb?color=24292e&label=Stars&logo=GitHub&logoColor=fff" alt="GitHub"></a></div>
|
3
|
+
<div align="center"><a href="https://discorb-lib.github.io/"><img src="https://img.shields.io/badge/Document-discorb--lib.github.io-blue.svg?style=flat-square&labelColor=2f3136" alt="Document"></a>
|
4
|
+
<a href="https://rubygems.org/gems/discorb"><img src="https://img.shields.io/gem/dt/discorb?logo=rubygems&logoColor=fff&label=Downloads&style=flat-square&labelColor=2f3136" alt="Gem"></a>
|
5
|
+
<a href="https://rubygems.org/gems/discorb"><img src="https://img.shields.io/gem/v/discorb?logo=rubygems&logoColor=fff&label=Version&style=flat-square&labelColor=2f3136" alt="Gem"></a>
|
6
|
+
<a href="https://discord.gg/hCP6zq8Vpj"><img src="https://img.shields.io/discord/863581274916913193?logo=discord&logoColor=fff&color=5865f2&label=Discord&style=flat-square&labelColor=2f3136" alt="Discord"></a>
|
7
|
+
<a href="https://github.com/discorb-lib/discorb"><img src="https://img.shields.io/github/stars/discorb-lib/discorb?color=24292e&label=Stars&logo=GitHub&logoColor=fff&style=flat-square&labelColor=2f3136" alt="GitHub"></a></div>
|
8
8
|
|
9
9
|
----
|
10
10
|
|
data/Rakefile
CHANGED
@@ -4,7 +4,7 @@ require "bundler/gem_tasks"
|
|
4
4
|
require_relative "lib/discorb/utils/colored_puts"
|
5
5
|
task default: %i[]
|
6
6
|
|
7
|
-
#
|
7
|
+
# @private
|
8
8
|
def get_version
|
9
9
|
require_relative "lib/discorb/common"
|
10
10
|
tag = `git tag --points-at HEAD`.force_encoding("utf-8").strip
|
@@ -90,6 +90,8 @@ namespace :document do
|
|
90
90
|
require_relative "template-replace/scripts/version.rb"
|
91
91
|
require_relative "template-replace/scripts/index.rb"
|
92
92
|
require_relative "template-replace/scripts/yard_replace.rb"
|
93
|
+
require_relative "template-replace/scripts/favicon.rb"
|
94
|
+
require_relative "template-replace/scripts/arrow.rb"
|
93
95
|
iputs "Resetting changes"
|
94
96
|
Dir.glob("doc/#{version}/**/*.html") do |f|
|
95
97
|
next if (m = f.match(/[0-9]+\.[0-9]+\.[0-9]+(-[a-z]+)?/)) && m[0] != version
|
@@ -109,6 +111,10 @@ namespace :document do
|
|
109
111
|
replace_index("doc/#{version}", version)
|
110
112
|
iputs "Replacing YARD credits"
|
111
113
|
yard_replace("doc/#{version}", version)
|
114
|
+
iputs "Adding favicon"
|
115
|
+
add_favicon("doc/#{version}")
|
116
|
+
iputs "Replacing arrow"
|
117
|
+
replace_arrow("doc/#{version}")
|
112
118
|
iputs "Successfully replaced htmls"
|
113
119
|
end
|
114
120
|
|
data/assets/banner.svg
CHANGED
@@ -1,101 +1,101 @@
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
2
|
-
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
3
|
-
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
4
|
-
<svg version="1.1" id="レイヤー_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px"
|
5
|
-
y="0px" width="1080px" height="150px" viewBox="0 0 1080 150" enable-background="new 0 0 1080 150" xml:space="preserve">
|
6
|
-
<rect x="0" fill="#FFFFFF" width="1080" height="150"/>
|
7
|
-
<g>
|
8
|
-
<g>
|
9
|
-
<defs>
|
10
|
-
<rect id="SVGID_1_" x="283.667" y="-12.667" width="343.333" height="201.333"/>
|
11
|
-
</defs>
|
12
|
-
<clipPath id="SVGID_2_">
|
13
|
-
<use xlink:href="#SVGID_1_" overflow="visible"/>
|
14
|
-
</clipPath>
|
15
|
-
<g clip-path="url(#SVGID_2_)">
|
16
|
-
<g>
|
17
|
-
<g>
|
18
|
-
<path fill="#2E3338" d="M370.532,119.061c-13.503,0-21.564-10.312-21.564-27.582c0-18.542,9.872-30.524,25.148-30.524
|
19
|
-
c5.187,0,10.446,0.915,14.433,2.509l3.429,1.372V31.79l6.393-1.006v86.997h-4.456l-1.936-12.146l-3.522,4.209
|
20
|
-
C383.265,116.045,377.402,119.061,370.532,119.061z M374.501,65.554c-9.191,0-19.014,6.676-19.014,25.413
|
21
|
-
c0,13.961,6.56,22.98,16.708,22.98c7.181,0,13.309-3.736,19.286-11.758l0.495-0.666V69.983l-1.358-0.697
|
22
|
-
C385.253,66.53,381.034,65.554,374.501,65.554z"/>
|
23
|
-
</g>
|
24
|
-
<g>
|
25
|
-
<path fill="#2E3338" d="M419.623,117.779V61.721h6.394v56.058H419.623z M422.884,44.433c-2.646,0-4.796-2.094-4.796-4.668
|
26
|
-
c0-2.6,2.195-4.796,4.796-4.796c2.573,0,4.668,2.152,4.668,4.796C427.552,42.338,425.457,44.433,422.884,44.433z"/>
|
27
|
-
</g>
|
28
|
-
<g>
|
29
|
-
<path fill="#2E3338" d="M463.332,119.061c-7.016,0-14.662-2.281-19.529-4.646l0.809-5.23
|
30
|
-
c4.905,2.795,11.627,5.405,19.616,5.405c9.34,0,14.917-3.948,14.917-10.563c0-8.188-6.482-10.383-16.372-12.797
|
31
|
-
c-13.937-3.485-18.19-7.314-18.19-16.389c0-8.611,7.639-14.397,19.006-14.397c6.173,0,11.984,1.055,17.305,3.139l-0.902,5.412
|
32
|
-
c-5.417-2.532-11.33-3.95-16.659-3.95c-12.06,0-12.997,7.302-12.997,9.54c0,6.303,5.57,8.979,14.56,11.256
|
33
|
-
c15.329,3.896,20.003,7.967,20.003,17.418C484.897,113.3,477.036,119.061,463.332,119.061z"/>
|
34
|
-
</g>
|
35
|
-
<g>
|
36
|
-
<path fill="#2E3338" d="M523.745,119.061c-15.985,0-25.917-11.205-25.917-29.246c0-17.842,10.273-29.373,26.174-29.373
|
37
|
-
c6.896,0,12.695,1.453,17.263,4.322l-0.821,5.493c-5.086-3.282-10.44-4.83-16.57-4.83c-12.043,0-19.524,9.296-19.524,24.262
|
38
|
-
c0,15.271,7.776,24.389,20.805,24.389c6.138,0,11.114-1.451,15.996-4.758l0.746,4.591
|
39
|
-
C536.669,117.51,531.15,119.061,523.745,119.061z"/>
|
40
|
-
</g>
|
41
|
-
<g>
|
42
|
-
<path fill="#2E3338" d="M580.834,119.061c-15.512,0-25.533-11.479-25.533-29.246c0-17.842,10.021-29.373,25.533-29.373
|
43
|
-
c15.743,0,25.916,11.53,25.916,29.373C606.75,107.581,596.577,119.061,580.834,119.061z M580.834,65.042
|
44
|
-
c-11.729,0-19.015,9.492-19.015,24.772c0,15.049,7.463,24.772,19.015,24.772c11.964,0,19.396-9.491,19.396-24.772
|
45
|
-
C600.23,74.766,592.616,65.042,580.834,65.042z"/>
|
46
|
-
</g>
|
47
|
-
<g>
|
48
|
-
<path d="M623.652,117.779V61.721h4.444l2.615,16.91l3.563-5.661c3.16-5.019,8.634-11.016,17.176-12.309l0.981,5.953
|
49
|
-
c-9.187,1.447-17.664,7.67-22.117,16.437l-0.271,0.533v34.195H623.652L623.652,117.779z"/>
|
50
|
-
</g>
|
51
|
-
<g>
|
52
|
-
<path d="M688.224,118.549c-8.271,0-14.268-1.167-21.311-3.208V31.79l6.394-1.006V72.56l4.295-4.43
|
53
|
-
c5.017-5.173,10.417-7.688,16.51-7.688c13.302,0,21.565,10.569,21.565,27.582C715.677,107.423,705.671,118.549,688.224,118.549
|
54
|
-
z M692.447,65.554c-6.539,0-12.794,3.675-18.593,10.922l-0.548,0.686v33.855l1.64,0.602c3.981,1.461,7.108,2.201,13.148,2.201
|
55
|
-
c9.607,0,21.062-4.387,21.062-25.284C709.156,74.575,702.598,65.554,692.447,65.554z"/>
|
56
|
-
</g>
|
57
|
-
</g>
|
58
|
-
</g>
|
59
|
-
</g>
|
60
|
-
</g>
|
61
|
-
<g>
|
62
|
-
<g>
|
63
|
-
<defs>
|
64
|
-
<rect id="SVGID_3_" x="610.334" y="8" width="268" height="246"/>
|
65
|
-
</defs>
|
66
|
-
<clipPath id="SVGID_4_">
|
67
|
-
<use xlink:href="#SVGID_3_" overflow="visible"/>
|
68
|
-
</clipPath>
|
69
|
-
<g clip-path="url(#SVGID_4_)">
|
70
|
-
<g>
|
71
|
-
<path fill="#2E3338" d="M391.781,120.279l-1.408-8.832c-4.607,5.505-10.88,10.113-19.841,10.113
|
72
|
-
c-13.185,0-24.064-9.602-24.064-30.082c0-22.272,12.8-33.025,27.648-33.025c6.018,0,11.521,1.152,15.361,2.688v-31.49
|
73
|
-
l11.393-1.792v92.42H391.781L391.781,120.279z M389.478,71.51c-4.736-2.432-8.448-3.456-14.977-3.456
|
74
|
-
c-9.602,0-16.514,7.809-16.514,22.913c0,13.441,6.017,20.48,14.208,20.48c7.041,0,12.417-4.225,17.281-10.752L389.478,71.51
|
75
|
-
L389.478,71.51z"/>
|
76
|
-
<path fill="#2E3338" d="M422.884,46.933c-3.968,0-7.296-3.2-7.296-7.168c0-3.968,3.328-7.296,7.296-7.296
|
77
|
-
s7.168,3.328,7.168,7.296C430.052,43.733,426.852,46.933,422.884,46.933z M417.123,120.279V59.221h11.394v61.058H417.123z"/>
|
78
|
-
<path fill="#2E3338" d="M463.332,121.561c-8.064,0-17.025-2.815-22.273-5.76l1.664-10.754c5.76,3.969,13.185,7.041,21.505,7.041
|
79
|
-
c7.808,0,12.417-2.943,12.417-8.064c0-5.633-3.456-7.68-14.465-10.367c-14.336-3.586-20.098-7.938-20.098-18.817
|
80
|
-
c0-9.729,8.192-16.897,21.506-16.897c7.552,0,14.336,1.536,20.097,4.096l-1.792,10.752c-5.376-3.072-12.161-5.248-18.561-5.248
|
81
|
-
c-6.913,0-10.498,2.688-10.498,7.04c0,4.096,3.072,6.4,12.673,8.832c15.104,3.841,21.889,8.193,21.889,19.842
|
82
|
-
C487.397,114.393,479.076,121.561,463.332,121.561z"/>
|
83
|
-
<path fill="#2E3338" d="M523.745,121.561c-16.385,0-28.417-11.393-28.417-31.746c0-20.864,12.801-31.873,28.674-31.873
|
84
|
-
c8.96,0,15.359,2.304,19.968,5.632l-1.664,11.136c-5.632-4.608-11.393-6.784-18.433-6.784c-9.984,0-17.024,7.552-17.024,21.761
|
85
|
-
c0,14.849,7.552,21.89,18.305,21.89c6.146,0,11.521-1.408,17.793-6.785l1.664,10.241
|
86
|
-
C538.339,119.768,531.938,121.561,523.745,121.561z"/>
|
87
|
-
<path fill="#2E3338" d="M580.834,121.561c-16.259,0-28.033-11.647-28.033-31.746c0-20.096,11.774-31.873,28.033-31.873
|
88
|
-
c16.385,0,28.416,11.776,28.416,31.873C609.25,109.912,597.219,121.561,580.834,121.561z M580.834,67.542
|
89
|
-
c-11.01,0-16.515,9.472-16.515,22.272c0,12.545,5.761,22.272,16.515,22.272c11.264,0,16.896-9.474,16.896-22.272
|
90
|
-
C597.73,77.271,591.842,67.542,580.834,67.542z"/>
|
91
|
-
<path fill="#CC342D" d="M632.545,84.184v36.098h-11.394v-61.06h9.088l1.92,12.417c4.354-6.913,11.394-13.185,21.377-13.697
|
92
|
-
l1.793,10.88C645.217,69.334,636.641,76.118,632.545,84.184z"/>
|
93
|
-
<path fill="#CC342D" d="M688.224,121.049c-9.217,0-15.745-1.408-23.811-3.841V29.652l11.394-1.792v38.53
|
94
|
-
c4.096-4.224,9.984-8.448,18.305-8.448c13.186,0,24.065,9.729,24.065,30.082C718.177,110.296,705.888,121.049,688.224,121.049z
|
95
|
-
M692.447,68.054c-6.399,0-12.032,4.224-16.641,9.984v31.233c3.84,1.408,6.656,2.049,12.288,2.049
|
96
|
-
c11.905,0,18.562-7.041,18.562-22.785C706.656,75.222,700.64,68.054,692.447,68.054z"/>
|
97
|
-
</g>
|
98
|
-
</g>
|
99
|
-
</g>
|
100
|
-
</g>
|
101
|
-
</svg>
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
3
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
4
|
+
<svg version="1.1" id="レイヤー_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px"
|
5
|
+
y="0px" width="1080px" height="150px" viewBox="0 0 1080 150" enable-background="new 0 0 1080 150" xml:space="preserve">
|
6
|
+
<rect x="0" fill="#FFFFFF" width="1080" height="150"/>
|
7
|
+
<g>
|
8
|
+
<g>
|
9
|
+
<defs>
|
10
|
+
<rect id="SVGID_1_" x="283.667" y="-12.667" width="343.333" height="201.333"/>
|
11
|
+
</defs>
|
12
|
+
<clipPath id="SVGID_2_">
|
13
|
+
<use xlink:href="#SVGID_1_" overflow="visible"/>
|
14
|
+
</clipPath>
|
15
|
+
<g clip-path="url(#SVGID_2_)">
|
16
|
+
<g>
|
17
|
+
<g>
|
18
|
+
<path fill="#2E3338" d="M370.532,119.061c-13.503,0-21.564-10.312-21.564-27.582c0-18.542,9.872-30.524,25.148-30.524
|
19
|
+
c5.187,0,10.446,0.915,14.433,2.509l3.429,1.372V31.79l6.393-1.006v86.997h-4.456l-1.936-12.146l-3.522,4.209
|
20
|
+
C383.265,116.045,377.402,119.061,370.532,119.061z M374.501,65.554c-9.191,0-19.014,6.676-19.014,25.413
|
21
|
+
c0,13.961,6.56,22.98,16.708,22.98c7.181,0,13.309-3.736,19.286-11.758l0.495-0.666V69.983l-1.358-0.697
|
22
|
+
C385.253,66.53,381.034,65.554,374.501,65.554z"/>
|
23
|
+
</g>
|
24
|
+
<g>
|
25
|
+
<path fill="#2E3338" d="M419.623,117.779V61.721h6.394v56.058H419.623z M422.884,44.433c-2.646,0-4.796-2.094-4.796-4.668
|
26
|
+
c0-2.6,2.195-4.796,4.796-4.796c2.573,0,4.668,2.152,4.668,4.796C427.552,42.338,425.457,44.433,422.884,44.433z"/>
|
27
|
+
</g>
|
28
|
+
<g>
|
29
|
+
<path fill="#2E3338" d="M463.332,119.061c-7.016,0-14.662-2.281-19.529-4.646l0.809-5.23
|
30
|
+
c4.905,2.795,11.627,5.405,19.616,5.405c9.34,0,14.917-3.948,14.917-10.563c0-8.188-6.482-10.383-16.372-12.797
|
31
|
+
c-13.937-3.485-18.19-7.314-18.19-16.389c0-8.611,7.639-14.397,19.006-14.397c6.173,0,11.984,1.055,17.305,3.139l-0.902,5.412
|
32
|
+
c-5.417-2.532-11.33-3.95-16.659-3.95c-12.06,0-12.997,7.302-12.997,9.54c0,6.303,5.57,8.979,14.56,11.256
|
33
|
+
c15.329,3.896,20.003,7.967,20.003,17.418C484.897,113.3,477.036,119.061,463.332,119.061z"/>
|
34
|
+
</g>
|
35
|
+
<g>
|
36
|
+
<path fill="#2E3338" d="M523.745,119.061c-15.985,0-25.917-11.205-25.917-29.246c0-17.842,10.273-29.373,26.174-29.373
|
37
|
+
c6.896,0,12.695,1.453,17.263,4.322l-0.821,5.493c-5.086-3.282-10.44-4.83-16.57-4.83c-12.043,0-19.524,9.296-19.524,24.262
|
38
|
+
c0,15.271,7.776,24.389,20.805,24.389c6.138,0,11.114-1.451,15.996-4.758l0.746,4.591
|
39
|
+
C536.669,117.51,531.15,119.061,523.745,119.061z"/>
|
40
|
+
</g>
|
41
|
+
<g>
|
42
|
+
<path fill="#2E3338" d="M580.834,119.061c-15.512,0-25.533-11.479-25.533-29.246c0-17.842,10.021-29.373,25.533-29.373
|
43
|
+
c15.743,0,25.916,11.53,25.916,29.373C606.75,107.581,596.577,119.061,580.834,119.061z M580.834,65.042
|
44
|
+
c-11.729,0-19.015,9.492-19.015,24.772c0,15.049,7.463,24.772,19.015,24.772c11.964,0,19.396-9.491,19.396-24.772
|
45
|
+
C600.23,74.766,592.616,65.042,580.834,65.042z"/>
|
46
|
+
</g>
|
47
|
+
<g>
|
48
|
+
<path d="M623.652,117.779V61.721h4.444l2.615,16.91l3.563-5.661c3.16-5.019,8.634-11.016,17.176-12.309l0.981,5.953
|
49
|
+
c-9.187,1.447-17.664,7.67-22.117,16.437l-0.271,0.533v34.195H623.652L623.652,117.779z"/>
|
50
|
+
</g>
|
51
|
+
<g>
|
52
|
+
<path d="M688.224,118.549c-8.271,0-14.268-1.167-21.311-3.208V31.79l6.394-1.006V72.56l4.295-4.43
|
53
|
+
c5.017-5.173,10.417-7.688,16.51-7.688c13.302,0,21.565,10.569,21.565,27.582C715.677,107.423,705.671,118.549,688.224,118.549
|
54
|
+
z M692.447,65.554c-6.539,0-12.794,3.675-18.593,10.922l-0.548,0.686v33.855l1.64,0.602c3.981,1.461,7.108,2.201,13.148,2.201
|
55
|
+
c9.607,0,21.062-4.387,21.062-25.284C709.156,74.575,702.598,65.554,692.447,65.554z"/>
|
56
|
+
</g>
|
57
|
+
</g>
|
58
|
+
</g>
|
59
|
+
</g>
|
60
|
+
</g>
|
61
|
+
<g>
|
62
|
+
<g>
|
63
|
+
<defs>
|
64
|
+
<rect id="SVGID_3_" x="610.334" y="8" width="268" height="246"/>
|
65
|
+
</defs>
|
66
|
+
<clipPath id="SVGID_4_">
|
67
|
+
<use xlink:href="#SVGID_3_" overflow="visible"/>
|
68
|
+
</clipPath>
|
69
|
+
<g clip-path="url(#SVGID_4_)">
|
70
|
+
<g>
|
71
|
+
<path fill="#2E3338" d="M391.781,120.279l-1.408-8.832c-4.607,5.505-10.88,10.113-19.841,10.113
|
72
|
+
c-13.185,0-24.064-9.602-24.064-30.082c0-22.272,12.8-33.025,27.648-33.025c6.018,0,11.521,1.152,15.361,2.688v-31.49
|
73
|
+
l11.393-1.792v92.42H391.781L391.781,120.279z M389.478,71.51c-4.736-2.432-8.448-3.456-14.977-3.456
|
74
|
+
c-9.602,0-16.514,7.809-16.514,22.913c0,13.441,6.017,20.48,14.208,20.48c7.041,0,12.417-4.225,17.281-10.752L389.478,71.51
|
75
|
+
L389.478,71.51z"/>
|
76
|
+
<path fill="#2E3338" d="M422.884,46.933c-3.968,0-7.296-3.2-7.296-7.168c0-3.968,3.328-7.296,7.296-7.296
|
77
|
+
s7.168,3.328,7.168,7.296C430.052,43.733,426.852,46.933,422.884,46.933z M417.123,120.279V59.221h11.394v61.058H417.123z"/>
|
78
|
+
<path fill="#2E3338" d="M463.332,121.561c-8.064,0-17.025-2.815-22.273-5.76l1.664-10.754c5.76,3.969,13.185,7.041,21.505,7.041
|
79
|
+
c7.808,0,12.417-2.943,12.417-8.064c0-5.633-3.456-7.68-14.465-10.367c-14.336-3.586-20.098-7.938-20.098-18.817
|
80
|
+
c0-9.729,8.192-16.897,21.506-16.897c7.552,0,14.336,1.536,20.097,4.096l-1.792,10.752c-5.376-3.072-12.161-5.248-18.561-5.248
|
81
|
+
c-6.913,0-10.498,2.688-10.498,7.04c0,4.096,3.072,6.4,12.673,8.832c15.104,3.841,21.889,8.193,21.889,19.842
|
82
|
+
C487.397,114.393,479.076,121.561,463.332,121.561z"/>
|
83
|
+
<path fill="#2E3338" d="M523.745,121.561c-16.385,0-28.417-11.393-28.417-31.746c0-20.864,12.801-31.873,28.674-31.873
|
84
|
+
c8.96,0,15.359,2.304,19.968,5.632l-1.664,11.136c-5.632-4.608-11.393-6.784-18.433-6.784c-9.984,0-17.024,7.552-17.024,21.761
|
85
|
+
c0,14.849,7.552,21.89,18.305,21.89c6.146,0,11.521-1.408,17.793-6.785l1.664,10.241
|
86
|
+
C538.339,119.768,531.938,121.561,523.745,121.561z"/>
|
87
|
+
<path fill="#2E3338" d="M580.834,121.561c-16.259,0-28.033-11.647-28.033-31.746c0-20.096,11.774-31.873,28.033-31.873
|
88
|
+
c16.385,0,28.416,11.776,28.416,31.873C609.25,109.912,597.219,121.561,580.834,121.561z M580.834,67.542
|
89
|
+
c-11.01,0-16.515,9.472-16.515,22.272c0,12.545,5.761,22.272,16.515,22.272c11.264,0,16.896-9.474,16.896-22.272
|
90
|
+
C597.73,77.271,591.842,67.542,580.834,67.542z"/>
|
91
|
+
<path fill="#CC342D" d="M632.545,84.184v36.098h-11.394v-61.06h9.088l1.92,12.417c4.354-6.913,11.394-13.185,21.377-13.697
|
92
|
+
l1.793,10.88C645.217,69.334,636.641,76.118,632.545,84.184z"/>
|
93
|
+
<path fill="#CC342D" d="M688.224,121.049c-9.217,0-15.745-1.408-23.811-3.841V29.652l11.394-1.792v38.53
|
94
|
+
c4.096-4.224,9.984-8.448,18.305-8.448c13.186,0,24.065,9.729,24.065,30.082C718.177,110.296,705.888,121.049,688.224,121.049z
|
95
|
+
M692.447,68.054c-6.399,0-12.032,4.224-16.641,9.984v31.233c3.84,1.408,6.656,2.049,12.288,2.049
|
96
|
+
c11.905,0,18.562-7.041,18.562-22.785C706.656,75.222,700.64,68.054,692.447,68.054z"/>
|
97
|
+
</g>
|
98
|
+
</g>
|
99
|
+
</g>
|
100
|
+
</g>
|
101
|
+
</svg>
|
data/docs/application_command.md
CHANGED
@@ -60,13 +60,14 @@ In `options`, hash should be like this:
|
|
60
60
|
}
|
61
61
|
}
|
62
62
|
```
|
63
|
-
|
64
|
-
|
|
65
|
-
|
|
66
|
-
| `
|
67
|
-
| `
|
68
|
-
| `
|
69
|
-
| `
|
63
|
+
| Key | Type | Description |
|
64
|
+
| --- | --- | --- |
|
65
|
+
| `:description` | `String` | Description of the option. |
|
66
|
+
| `:required` | Whether the argument is required. `optional` will be used if not specified. |
|
67
|
+
| `:optional` | Whether the argument is optional. `required` will be used if not specified. |
|
68
|
+
| `:type` | `Object` | Type of the option. |
|
69
|
+
| `:choice` | `Hash{String => String, Integer, Float}` | Type of the option. |
|
70
|
+
| `:default` | `Object` | Default value of the option. |
|
70
71
|
|
71
72
|
`choices` should be unspecified if you don't want to use it.
|
72
73
|
`choices` is hash like this:
|
data/docs/cli/run.md
CHANGED
@@ -19,9 +19,9 @@ The script to run. Defaults to `main.rb`.
|
|
19
19
|
|
20
20
|
### Options
|
21
21
|
|
22
|
-
#### `-
|
22
|
+
#### `-t`, `--title`
|
23
23
|
|
24
|
-
|
24
|
+
The title of the process.
|
25
25
|
|
26
26
|
#### `-l`, `--log-level`
|
27
27
|
|
@@ -51,6 +51,6 @@ If not specified, the default will be:
|
|
51
51
|
|
52
52
|
Whether to setup application commands.
|
53
53
|
|
54
|
-
#### `-
|
54
|
+
#### `-e`, `--env`
|
55
55
|
|
56
56
|
The name of the environment variable to use for token, or just `-t` or `--token` for intractive prompt.
|
data/docs/faq.md
CHANGED
data/docs/license.md
CHANGED
data/lib/discorb/app_command.rb
CHANGED
@@ -20,9 +20,11 @@ module Discorb
|
|
20
20
|
# | Key | Type | Description |
|
21
21
|
# | --- | --- | --- |
|
22
22
|
# | `:description` | `String` | Description of the option. |
|
23
|
-
# | `:
|
23
|
+
# | `:required` | Whether the argument is required. `optional` will be used if not specified. |
|
24
|
+
# | `:optional` | Whether the argument is optional. `required` will be used if not specified. |
|
24
25
|
# | `:type` | `Object` | Type of the option. |
|
25
26
|
# | `:choice` | `Hash{String => String, Integer, Float}` | Type of the option. |
|
27
|
+
# | `:default` | `Object` | Default value of the option. |
|
26
28
|
#
|
27
29
|
# @param [Array<#to_s>, false, nil] guild_ids Guild IDs to set the command to. `false` to global command, `nil` to use default.
|
28
30
|
# @param [Proc] block Command block.
|
@@ -157,7 +159,7 @@ module Discorb
|
|
157
159
|
3 => :message,
|
158
160
|
}.freeze
|
159
161
|
|
160
|
-
#
|
162
|
+
# @private
|
161
163
|
def initialize(name, guild_ids, block, type)
|
162
164
|
@name = name
|
163
165
|
@guild_ids = guild_ids&.map(&:to_s)
|
@@ -168,7 +170,7 @@ module Discorb
|
|
168
170
|
@id_map = Discorb::Dictionary.new
|
169
171
|
end
|
170
172
|
|
171
|
-
#
|
173
|
+
# @private
|
172
174
|
def to_hash
|
173
175
|
{
|
174
176
|
name: @name,
|
@@ -186,7 +188,7 @@ module Discorb
|
|
186
188
|
# @return [Hash{String => Hash}] The options of the command.
|
187
189
|
attr_reader :options
|
188
190
|
|
189
|
-
#
|
191
|
+
# @private
|
190
192
|
def initialize(name, description, options, guild_ids, block, type, parent)
|
191
193
|
super(name, guild_ids, block, type)
|
192
194
|
@description = description
|
@@ -205,7 +207,7 @@ module Discorb
|
|
205
207
|
(@parent + " " + @name).strip
|
206
208
|
end
|
207
209
|
|
208
|
-
#
|
210
|
+
# @private
|
209
211
|
def to_hash
|
210
212
|
options_payload = options.map do |name, value|
|
211
213
|
ret = {
|
@@ -231,7 +233,7 @@ module Discorb
|
|
231
233
|
end,
|
232
234
|
name: name,
|
233
235
|
description: value[:description],
|
234
|
-
required: !value[:optional],
|
236
|
+
required: value[:required].nil? ? !value[:optional] : value[:required],
|
235
237
|
}
|
236
238
|
if value[:choices]
|
237
239
|
ret[:choices] = value[:choices].map { |t| { name: t[0], value: t[1] } }
|
@@ -256,7 +258,7 @@ module Discorb
|
|
256
258
|
# @return [String] The description of the command.
|
257
259
|
attr_reader :description
|
258
260
|
|
259
|
-
#
|
261
|
+
# @private
|
260
262
|
def initialize(name, description, guild_ids, type, client)
|
261
263
|
super(name, guild_ids, block, type)
|
262
264
|
@description = description
|
@@ -307,7 +309,7 @@ module Discorb
|
|
307
309
|
@name
|
308
310
|
end
|
309
311
|
|
310
|
-
#
|
312
|
+
# @private
|
311
313
|
def to_hash
|
312
314
|
options_payload = @commands.map do |command|
|
313
315
|
if command.is_a?(SlashCommand)
|
@@ -345,7 +347,7 @@ module Discorb
|
|
345
347
|
# @return [Array<Discorb::ApplicationCommand::Command::SlashCommand>] The subcommands of the command.
|
346
348
|
attr_reader :commands
|
347
349
|
|
348
|
-
#
|
350
|
+
# @private
|
349
351
|
def initialize(name, description, parent, client)
|
350
352
|
super(name, description, [], 1, client)
|
351
353
|
|
@@ -371,7 +373,7 @@ module Discorb
|
|
371
373
|
end
|
372
374
|
|
373
375
|
class << self
|
374
|
-
#
|
376
|
+
# @private
|
375
377
|
attr_reader :types
|
376
378
|
end
|
377
379
|
end
|
data/lib/discorb/application.rb
CHANGED
@@ -28,7 +28,7 @@ module Discorb
|
|
28
28
|
attr_reader :bot_require_code_grant
|
29
29
|
alias bot_require_code_grant? bot_require_code_grant
|
30
30
|
|
31
|
-
#
|
31
|
+
# @private
|
32
32
|
def initialize(client, data)
|
33
33
|
@client = client
|
34
34
|
@data = data
|
@@ -67,7 +67,7 @@ module Discorb
|
|
67
67
|
# @return [Discorb::Application::Team::Member] The team's member.
|
68
68
|
attr_reader :members
|
69
69
|
|
70
|
-
#
|
70
|
+
# @private
|
71
71
|
def initialize(client, data)
|
72
72
|
@client = client
|
73
73
|
@id = Snowflake.new(data[:id])
|
@@ -148,7 +148,7 @@ module Discorb
|
|
148
148
|
end
|
149
149
|
|
150
150
|
class << self
|
151
|
-
#
|
151
|
+
# @private
|
152
152
|
attr_reader :membership_state
|
153
153
|
end
|
154
154
|
end
|
data/lib/discorb/asset.rb
CHANGED
@@ -11,7 +11,7 @@ module Discorb
|
|
11
11
|
# @!attribute [r] animated?
|
12
12
|
# @return [Boolean] Whether the asset is animated.
|
13
13
|
|
14
|
-
#
|
14
|
+
# @private
|
15
15
|
def initialize(target, hash, path: nil)
|
16
16
|
@hash = hash
|
17
17
|
@target = target
|
@@ -63,7 +63,7 @@ module Discorb
|
|
63
63
|
# @!attribute [r] animated?
|
64
64
|
# @return [false] For compatibility with {Asset}, always `false`.
|
65
65
|
|
66
|
-
#
|
66
|
+
# @private
|
67
67
|
def initialize(discriminator)
|
68
68
|
@discriminator = discriminator.to_s.rjust(4, "0")
|
69
69
|
end
|
data/lib/discorb/audit_logs.rb
CHANGED
@@ -14,7 +14,7 @@ module Discorb
|
|
14
14
|
# @return [Array<Discorb::AuditLog::Entry>] The entries in this audit log.
|
15
15
|
attr_reader :entries
|
16
16
|
|
17
|
-
#
|
17
|
+
# @private
|
18
18
|
def initialize(client, data, guild)
|
19
19
|
@client = client
|
20
20
|
@guild = guild
|
@@ -105,7 +105,7 @@ module Discorb
|
|
105
105
|
# @!attribute [r] user
|
106
106
|
# @return [Discorb::User] The user who performed the action.
|
107
107
|
|
108
|
-
#
|
108
|
+
# @private
|
109
109
|
@events = {
|
110
110
|
1 => :guild_update,
|
111
111
|
10 => :channel_create,
|
@@ -153,7 +153,7 @@ module Discorb
|
|
153
153
|
112 => :thread_delete
|
154
154
|
}.freeze
|
155
155
|
|
156
|
-
#
|
156
|
+
# @private
|
157
157
|
@converts = {
|
158
158
|
channel: ->(client, id, _guild_id) { client.channels[id] },
|
159
159
|
thread: ->(client, id, _guild_id) { client.channels[id] },
|
@@ -163,7 +163,7 @@ module Discorb
|
|
163
163
|
message: ->(client, id, _guild_id) { client.messages[id] }
|
164
164
|
}
|
165
165
|
|
166
|
-
#
|
166
|
+
# @private
|
167
167
|
def initialize(client, data, guild_id)
|
168
168
|
@client = client
|
169
169
|
@guild_id = Snowflake.new(guild_id)
|
@@ -217,7 +217,7 @@ module Discorb
|
|
217
217
|
attr_reader :data
|
218
218
|
|
219
219
|
#
|
220
|
-
#
|
220
|
+
# @private
|
221
221
|
#
|
222
222
|
def initialize(data)
|
223
223
|
@data = data.map { |d| [d[:key].to_sym, d] }.to_h
|
@@ -264,7 +264,7 @@ module Discorb
|
|
264
264
|
# @return [Object] The new value of the change.
|
265
265
|
attr_reader :new_value
|
266
266
|
|
267
|
-
#
|
267
|
+
# @private
|
268
268
|
def initialize(data)
|
269
269
|
@key = data[:key].to_sym
|
270
270
|
method = case @key.to_s
|
@@ -309,7 +309,7 @@ module Discorb
|
|
309
309
|
# @return [Discorb::Integration::Account] The account of the integration.
|
310
310
|
attr_reader :account
|
311
311
|
|
312
|
-
#
|
312
|
+
# @private
|
313
313
|
def initialize(data)
|
314
314
|
@id = Snowflake.new(data[:id])
|
315
315
|
@type = data[:type].to_sym
|