discorb 0.10.1 → 0.10.2
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/Changelog.md +5 -0
- data/docs/application_command.md +1 -0
- data/docs/cli/init.md +3 -3
- data/docs/tutorial.md +1 -1
- data/lib/discorb/app_command.rb +4 -0
- data/lib/discorb/common.rb +1 -1
- data/lib/discorb/exe/{init.rb → new.rb} +1 -1
- data/template-replace/scripts/version.rb +7 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5ea8e05d77b37b7a269b43dff64422e3d49b08d6c09a639d40dc019baaa26a8c
|
4
|
+
data.tar.gz: c8ea6f45759aaf22112f6400f7d950fb09f427f98d01302a18094ad3d6a3ae08
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b3f5e77107192aec6943087251c5b61ab1476eb421ddb0297d61178e5146466a5a59c50f4665a2b81c362d927765259142ed1bc08ed9c07e3018102becab3294
|
7
|
+
data.tar.gz: b88f74d4f3e0f0025f7086e95c2b1e2b96ed19a35a258a72dd29f1814986465ac9fdd8443f920fe8b7dcd610d35871b59354ba8cc6b478bcf883797cd17d463d
|
data/Changelog.md
CHANGED
data/docs/application_command.md
CHANGED
@@ -68,6 +68,7 @@ In `options`, hash should be like this:
|
|
68
68
|
| `:type` | `Object` | Type of the option. |
|
69
69
|
| `:choice` | `Hash{String => String, Integer, Float}` | Type of the option. |
|
70
70
|
| `:default` | `Object` | Default value of the option. |
|
71
|
+
| `:channel_types` | `Array<Class<Discorb::Channel>>` | Type of the channel option. |
|
71
72
|
|
72
73
|
`choices` should be unspecified if you don't want to use it.
|
73
74
|
`choices` is hash like this:
|
data/docs/cli/init.md
CHANGED
@@ -1,13 +1,13 @@
|
|
1
|
-
# @title CLI: discorb
|
1
|
+
# @title CLI: discorb new
|
2
2
|
|
3
|
-
# discorb
|
3
|
+
# discorb new
|
4
4
|
|
5
5
|
This command will create a new project in the directory.
|
6
6
|
|
7
7
|
## Usage
|
8
8
|
|
9
9
|
```bash
|
10
|
-
discorb
|
10
|
+
discorb new [options] [dir]
|
11
11
|
```
|
12
12
|
|
13
13
|
## Options
|
data/docs/tutorial.md
CHANGED
data/lib/discorb/app_command.rb
CHANGED
@@ -25,6 +25,7 @@ module Discorb
|
|
25
25
|
# | `:type` | `Object` | Type of the option. |
|
26
26
|
# | `:choice` | `Hash{String => String, Integer, Float}` | Type of the option. |
|
27
27
|
# | `:default` | `Object` | Default value of the option. |
|
28
|
+
# | `:channel_types` | `Array<Class<Discorb::Channel>>` | Type of the channel option. |
|
28
29
|
#
|
29
30
|
# @param [Array<#to_s>, false, nil] guild_ids Guild IDs to set the command to. `false` to global command, `nil` to use default.
|
30
31
|
# @param [Proc] block Command block.
|
@@ -238,6 +239,9 @@ module Discorb
|
|
238
239
|
if value[:choices]
|
239
240
|
ret[:choices] = value[:choices].map { |t| { name: t[0], value: t[1] } }
|
240
241
|
end
|
242
|
+
if value[:channel_types]
|
243
|
+
ret[:channel_types] = value[:channel_types].map(&:channel_type)
|
244
|
+
end
|
241
245
|
ret
|
242
246
|
end
|
243
247
|
{
|
data/lib/discorb/common.rb
CHANGED
@@ -4,7 +4,7 @@ module Discorb
|
|
4
4
|
# @return [String] The API base URL.
|
5
5
|
API_BASE_URL = "https://discord.com/api/v9"
|
6
6
|
# @return [String] The version of discorb.
|
7
|
-
VERSION = "0.10.
|
7
|
+
VERSION = "0.10.2"
|
8
8
|
# @return [String] The user agent for the bot.
|
9
9
|
USER_AGENT = "DiscordBot (https://discorb-lib.github.io #{VERSION}) Ruby/#{RUBY_VERSION}"
|
10
10
|
|
@@ -4,7 +4,12 @@ def build_version_sidebar(dir, version)
|
|
4
4
|
raw.gsub!(template, "")
|
5
5
|
res = +""
|
6
6
|
i = 0
|
7
|
-
`git tag
|
7
|
+
`git tag`
|
8
|
+
.force_encoding("utf-8")
|
9
|
+
.split("\n")
|
10
|
+
.sort_by { |v| Gem::Version.new(v[1..]) }
|
11
|
+
.reverse
|
12
|
+
.each.with_index do |tag|
|
8
13
|
i += 1
|
9
14
|
sha = `git rev-parse #{tag}`.force_encoding("utf-8").strip
|
10
15
|
tag_version = tag.delete_prefix("v")
|
@@ -32,7 +37,7 @@ def build_version_sidebar(dir, version)
|
|
32
37
|
cls = i % 2 == 0 ? "even" : "odd"
|
33
38
|
res.insert 0, template
|
34
39
|
.gsub("!version!", "Latest")
|
35
|
-
.gsub("!path!", "
|
40
|
+
.gsub("!path!", "")
|
36
41
|
.gsub("!class!", cls)
|
37
42
|
.gsub("!sha!", "Latest on RubyGems")
|
38
43
|
File.write(dir + "/version_list.html", raw.gsub("<!--replace-->", res))
|
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.10.
|
4
|
+
version: 0.10.2
|
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-10-
|
11
|
+
date: 2021-10-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: async
|
@@ -142,8 +142,8 @@ files:
|
|
142
142
|
- lib/discorb/error.rb
|
143
143
|
- lib/discorb/event.rb
|
144
144
|
- lib/discorb/exe/about.rb
|
145
|
-
- lib/discorb/exe/init.rb
|
146
145
|
- lib/discorb/exe/irb.rb
|
146
|
+
- lib/discorb/exe/new.rb
|
147
147
|
- lib/discorb/exe/run.rb
|
148
148
|
- lib/discorb/exe/setup.rb
|
149
149
|
- lib/discorb/exe/show.rb
|