discorb 0.0.8 → 0.2.3
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/.yardopts +2 -1
- data/Changelog.md +51 -1
- data/Gemfile +0 -6
- data/Gemfile.lock +2 -6
- data/docs/application_command.md +251 -0
- data/docs/discord_irb.md +39 -0
- data/docs/events.md +10 -10
- data/docs/extension.md +53 -0
- data/examples/commands/bookmarker.rb +41 -0
- data/examples/commands/hello.rb +9 -0
- data/examples/commands/inspect.rb +24 -0
- data/examples/components/authorization_button.rb +1 -1
- data/examples/components/select_menu.rb +1 -1
- data/exe/discord-irb +60 -0
- data/lib/discorb/asset.rb +34 -0
- data/lib/discorb/channel.rb +4 -4
- data/lib/discorb/client.rb +55 -13
- data/lib/discorb/command.rb +393 -0
- data/lib/discorb/common.rb +7 -5
- data/lib/discorb/dictionary.rb +1 -1
- data/lib/discorb/embed.rb +7 -7
- data/lib/discorb/emoji.rb +6 -1
- data/lib/discorb/emoji_table.rb +9 -2
- data/lib/discorb/error.rb +4 -1
- data/lib/discorb/extension.rb +5 -2
- data/lib/discorb/gateway.rb +487 -478
- data/lib/discorb/http.rb +1 -1
- data/lib/discorb/interaction.rb +131 -19
- data/lib/discorb/log.rb +1 -1
- data/lib/discorb/member.rb +10 -1
- data/lib/discorb/message.rb +27 -0
- data/lib/discorb/modules.rb +76 -3
- data/lib/discorb/user.rb +8 -3
- data/lib/discorb/webhook.rb +12 -1
- data/lib/discorb.rb +7 -7
- metadata +12 -3
data/lib/discorb/webhook.rb
CHANGED
@@ -377,9 +377,20 @@ module Discorb
|
|
377
377
|
@bot = data[:bot]
|
378
378
|
@id = Snowflake.new(data[:id])
|
379
379
|
@username = data[:username]
|
380
|
-
@avatar = data[:avatar]
|
380
|
+
@avatar = data[:avatar] ? Asset.new(self, data[:avatar]) : DefaultAvatar.new(data[:discriminator])
|
381
381
|
@discriminator = data[:discriminator]
|
382
382
|
end
|
383
|
+
|
384
|
+
#
|
385
|
+
# Format author with `Name#Discriminator` style.
|
386
|
+
#
|
387
|
+
# @return [String] Formatted author.
|
388
|
+
#
|
389
|
+
def to_s
|
390
|
+
"#{@username}##{@discriminator}"
|
391
|
+
end
|
392
|
+
|
393
|
+
alias to_s_user to_s
|
383
394
|
end
|
384
395
|
end
|
385
396
|
|
data/lib/discorb.rb
CHANGED
@@ -24,17 +24,17 @@ module Discorb
|
|
24
24
|
#
|
25
25
|
def macro
|
26
26
|
# NOTE: this method is only for YARD.
|
27
|
-
puts
|
27
|
+
puts "Wow, You found the easter egg!\n"
|
28
28
|
red = "\e[31m"
|
29
29
|
reset = "\e[m"
|
30
30
|
puts <<~"EASTEREGG"
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
31
|
+
. #{red} #{reset}
|
32
|
+
| #{red} | #{reset}
|
33
|
+
__| | __ __ _ #{red} _ |__ #{reset}
|
34
|
+
/ | | (__ / / \\ #{red}|/ | \\ #{reset}
|
35
35
|
\\__| | __) \\__ \\_/ #{red}| |__/ #{reset}
|
36
36
|
|
37
|
-
|
37
|
+
Thank you for using this library!
|
38
38
|
EASTEREGG
|
39
39
|
end
|
40
40
|
end
|
@@ -44,7 +44,7 @@ require_order = %w[common flag dictionary error http intents emoji_table modules
|
|
44
44
|
%w[application audit_logs color components event extension] +
|
45
45
|
%w[file guild_template image integration interaction invite log permission] +
|
46
46
|
%w[presence reaction role sticker utils voice_state webhook] +
|
47
|
-
%w[gateway_requests gateway] +
|
47
|
+
%w[gateway_requests gateway command] +
|
48
48
|
%w[asset client extend]
|
49
49
|
require_order.each do |name|
|
50
50
|
require_relative "discorb/#{name}.rb"
|
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.
|
4
|
+
version: 0.2.3
|
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-
|
11
|
+
date: 2021-09-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: async
|
@@ -69,7 +69,8 @@ dependencies:
|
|
69
69
|
description:
|
70
70
|
email:
|
71
71
|
- sevenc-nanashi@sevenbot.jp
|
72
|
-
executables:
|
72
|
+
executables:
|
73
|
+
- discord-irb
|
73
74
|
extensions: []
|
74
75
|
extra_rdoc_files: []
|
75
76
|
files:
|
@@ -85,8 +86,14 @@ files:
|
|
85
86
|
- bin/setup
|
86
87
|
- discorb.gemspec
|
87
88
|
- docs/Examples.md
|
89
|
+
- docs/application_command.md
|
90
|
+
- docs/discord_irb.md
|
88
91
|
- docs/events.md
|
92
|
+
- docs/extension.md
|
89
93
|
- docs/voice_events.md
|
94
|
+
- examples/commands/bookmarker.rb
|
95
|
+
- examples/commands/hello.rb
|
96
|
+
- examples/commands/inspect.rb
|
90
97
|
- examples/components/authorization_button.rb
|
91
98
|
- examples/components/select_menu.rb
|
92
99
|
- examples/extension/main.rb
|
@@ -95,6 +102,7 @@ files:
|
|
95
102
|
- examples/simple/ping_pong.rb
|
96
103
|
- examples/simple/rolepanel.rb
|
97
104
|
- examples/simple/wait_for_message.rb
|
105
|
+
- exe/discord-irb
|
98
106
|
- lib/discorb.rb
|
99
107
|
- lib/discorb/application.rb
|
100
108
|
- lib/discorb/asset.rb
|
@@ -102,6 +110,7 @@ files:
|
|
102
110
|
- lib/discorb/channel.rb
|
103
111
|
- lib/discorb/client.rb
|
104
112
|
- lib/discorb/color.rb
|
113
|
+
- lib/discorb/command.rb
|
105
114
|
- lib/discorb/common.rb
|
106
115
|
- lib/discorb/components.rb
|
107
116
|
- lib/discorb/dictionary.rb
|