discorb 0.12.0 → 0.12.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/PULL_REQUEST_TEMPLATE.md +30 -0
- data/CONTRIBUTING.md +25 -0
- data/Changelog.md +5 -0
- data/lib/discorb/client.rb +2 -2
- data/lib/discorb/common.rb +1 -1
- data/lib/discorb/user.rb +7 -0
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2f43c7785e34661458d9837fd1e75877b8d343f8c920021624d92d0fb87c5ee3
|
4
|
+
data.tar.gz: f5b1ed37f600c0b2945d737a154c9d07155d38dad1b8c3da58fc209fa2db99a9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 42f7ffe2b1a851123d883f98223b7c8a755d40faff16a29c1eeecc58e3e023817c5a865bd2aaab52001a8311458a656e034de1f3349ed7778b033afd49840634
|
7
|
+
data.tar.gz: 3a6789362788a6c16e38ead2f6d463162f6e852da84df703ef90e32e27477fafb3ce611c931c9f1d9516275f21fb7229e4cec51b0110720b870a2d30f474120d
|
@@ -0,0 +1,30 @@
|
|
1
|
+
## What does this PR do?
|
2
|
+
|
3
|
+
<!--
|
4
|
+
Please describe the changes you are making (be as descriptive as possible).
|
5
|
+
Ex: Fix `Foo#bar`
|
6
|
+
Add `Hoge#fuga`
|
7
|
+
-->
|
8
|
+
|
9
|
+
## Information
|
10
|
+
|
11
|
+
- [ ] This PR fixes an issue.
|
12
|
+
- [ ] This PR adds a new feature.
|
13
|
+
- [ ] This PR refactors code.
|
14
|
+
- [ ] This PR has breaking changes.
|
15
|
+
- [ ] This PR **won't** change the behavior of the code. (e.g. documentation)
|
16
|
+
<!-- If you need to add more information, please add it here. -->
|
17
|
+
|
18
|
+
|
19
|
+
## Checklist
|
20
|
+
|
21
|
+
- [ ] I have reviewed the code and it is clean and well documented.
|
22
|
+
- [ ] I have ran bot and it is working as expected.
|
23
|
+
- [ ] I have updated the document.
|
24
|
+
|
25
|
+
## Related issues
|
26
|
+
|
27
|
+
<!--
|
28
|
+
If there are any related issues, please add them here.
|
29
|
+
If there are no related issues, please write `None`.
|
30
|
+
-->
|
data/CONTRIBUTING.md
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# Contributing to the project
|
2
|
+
|
3
|
+
## Submitting a bug report
|
4
|
+
|
5
|
+
Please follow these steps to report a bug:
|
6
|
+
1. Check if the bug already exists in issue tracker. Don't forget to search closed issues too.
|
7
|
+
2. Create issue from [the template](https://github.com/discorb-lib/discorb/issues/new?assignees=&labels=bug&template=bug_report.md).
|
8
|
+
3. Fill in the issue with the information about the bug.
|
9
|
+
4. Submit the issue.
|
10
|
+
|
11
|
+
## Submitting a feature request
|
12
|
+
|
13
|
+
Please follow these steps to request a feature:
|
14
|
+
1. Check if the feature already exists in main branch.
|
15
|
+
2. Check if the request already exists in issue tracker. Don't forget to search closed issues too.
|
16
|
+
3. Create issue from [the template](https://github.com/discorb-lib/discorb/issues/new?assignees=&labels=Feature+Request%2CEnhancement&template=feature_request.md).
|
17
|
+
4. Fill in the issue with the information about the feature.
|
18
|
+
5. Submit the issue.
|
19
|
+
|
20
|
+
## Submitting a pull request
|
21
|
+
|
22
|
+
Please follow these steps to request a pull request:
|
23
|
+
1. Check if the thing you want to request already exists in main branch.
|
24
|
+
2. Check if the request already exists and is merged or closed.
|
25
|
+
3. [Create a pull request](https://github.com/discorb-lib/discorb/compare).
|
data/Changelog.md
CHANGED
data/lib/discorb/client.rb
CHANGED
@@ -420,11 +420,11 @@ module Discorb
|
|
420
420
|
#
|
421
421
|
# @param [String, nil] token The token to use.
|
422
422
|
#
|
423
|
-
# @note If the token is nil, you should use `discorb run` with the `-
|
423
|
+
# @note If the token is nil, you should use `discorb run` with the `-e` or `--env` option.
|
424
424
|
#
|
425
425
|
def run(token = nil)
|
426
426
|
token ||= ENV["DISCORB_CLI_TOKEN"]
|
427
|
-
raise ArgumentError, "Token is not specified, and -
|
427
|
+
raise ArgumentError, "Token is not specified, and -e/--env is not specified" if token.nil?
|
428
428
|
case ENV["DISCORB_CLI_FLAG"]
|
429
429
|
when nil
|
430
430
|
start_client(token)
|
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.12.
|
7
|
+
VERSION = "0.12.1"
|
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
|
|
data/lib/discorb/user.rb
CHANGED
@@ -26,6 +26,9 @@ module Discorb
|
|
26
26
|
|
27
27
|
include Discorb::Messageable
|
28
28
|
|
29
|
+
# @!attribute [r] mention
|
30
|
+
# @return [String] The user's mention.
|
31
|
+
|
29
32
|
# @private
|
30
33
|
def initialize(client, data)
|
31
34
|
@client = client
|
@@ -43,6 +46,10 @@ module Discorb
|
|
43
46
|
"#{@username}##{@discriminator}"
|
44
47
|
end
|
45
48
|
|
49
|
+
def mention
|
50
|
+
"<@#{@id}>"
|
51
|
+
end
|
52
|
+
|
46
53
|
alias to_s_user to_s
|
47
54
|
|
48
55
|
def inspect
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: discorb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.12.
|
4
|
+
version: 0.12.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sevenc-nanashi
|
@@ -77,11 +77,13 @@ files:
|
|
77
77
|
- ".github/ISSUE_TEMPLATE/bug_report.md"
|
78
78
|
- ".github/ISSUE_TEMPLATE/config.yml"
|
79
79
|
- ".github/ISSUE_TEMPLATE/feature_request.md"
|
80
|
+
- ".github/PULL_REQUEST_TEMPLATE.md"
|
80
81
|
- ".github/workflows/build_main.yml"
|
81
82
|
- ".github/workflows/build_version.yml"
|
82
83
|
- ".github/workflows/package_register.yml"
|
83
84
|
- ".gitignore"
|
84
85
|
- ".yardopts"
|
86
|
+
- CONTRIBUTING.md
|
85
87
|
- Changelog.md
|
86
88
|
- Gemfile
|
87
89
|
- LICENSE.txt
|