discordrb 3.3.0 → 3.4.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +126 -0
- data/.github/ISSUE_TEMPLATE/bug_report.md +39 -0
- data/.github/ISSUE_TEMPLATE/feature_request.md +25 -0
- data/.github/pull_request_template.md +37 -0
- data/.rubocop.yml +34 -37
- data/.travis.yml +5 -6
- data/CHANGELOG.md +504 -347
- data/Gemfile +2 -0
- data/LICENSE.txt +1 -1
- data/README.md +61 -79
- data/Rakefile +2 -0
- data/bin/console +1 -0
- data/discordrb-webhooks.gemspec +6 -6
- data/discordrb.gemspec +18 -18
- data/lib/discordrb/allowed_mentions.rb +36 -0
- data/lib/discordrb/api/channel.rb +62 -39
- data/lib/discordrb/api/invite.rb +3 -3
- data/lib/discordrb/api/server.rb +57 -50
- data/lib/discordrb/api/user.rb +9 -8
- data/lib/discordrb/api/webhook.rb +6 -6
- data/lib/discordrb/api.rb +40 -15
- data/lib/discordrb/await.rb +0 -1
- data/lib/discordrb/bot.rb +175 -73
- data/lib/discordrb/cache.rb +4 -2
- data/lib/discordrb/colour_rgb.rb +43 -0
- data/lib/discordrb/commands/command_bot.rb +30 -9
- data/lib/discordrb/commands/container.rb +20 -23
- data/lib/discordrb/commands/parser.rb +18 -18
- data/lib/discordrb/commands/rate_limiter.rb +3 -2
- data/lib/discordrb/container.rb +77 -17
- data/lib/discordrb/data/activity.rb +271 -0
- data/lib/discordrb/data/application.rb +50 -0
- data/lib/discordrb/data/attachment.rb +56 -0
- data/lib/discordrb/data/audit_logs.rb +345 -0
- data/lib/discordrb/data/channel.rb +849 -0
- data/lib/discordrb/data/embed.rb +251 -0
- data/lib/discordrb/data/emoji.rb +82 -0
- data/lib/discordrb/data/integration.rb +83 -0
- data/lib/discordrb/data/invite.rb +137 -0
- data/lib/discordrb/data/member.rb +297 -0
- data/lib/discordrb/data/message.rb +334 -0
- data/lib/discordrb/data/overwrite.rb +102 -0
- data/lib/discordrb/data/profile.rb +91 -0
- data/lib/discordrb/data/reaction.rb +33 -0
- data/lib/discordrb/data/recipient.rb +34 -0
- data/lib/discordrb/data/role.rb +191 -0
- data/lib/discordrb/data/server.rb +1002 -0
- data/lib/discordrb/data/user.rb +204 -0
- data/lib/discordrb/data/voice_region.rb +45 -0
- data/lib/discordrb/data/voice_state.rb +41 -0
- data/lib/discordrb/data/webhook.rb +145 -0
- data/lib/discordrb/data.rb +25 -4180
- data/lib/discordrb/errors.rb +2 -1
- data/lib/discordrb/events/bans.rb +7 -5
- data/lib/discordrb/events/channels.rb +2 -0
- data/lib/discordrb/events/guilds.rb +16 -9
- data/lib/discordrb/events/invites.rb +125 -0
- data/lib/discordrb/events/members.rb +6 -2
- data/lib/discordrb/events/message.rb +69 -27
- data/lib/discordrb/events/presence.rb +14 -4
- data/lib/discordrb/events/raw.rb +1 -3
- data/lib/discordrb/events/reactions.rb +49 -3
- data/lib/discordrb/events/typing.rb +6 -4
- data/lib/discordrb/events/voice_server_update.rb +47 -0
- data/lib/discordrb/events/voice_state_update.rb +15 -10
- data/lib/discordrb/events/webhooks.rb +9 -6
- data/lib/discordrb/gateway.rb +72 -57
- data/lib/discordrb/id_object.rb +39 -0
- data/lib/discordrb/light/integrations.rb +1 -1
- data/lib/discordrb/light/light_bot.rb +1 -1
- data/lib/discordrb/logger.rb +4 -4
- data/lib/discordrb/paginator.rb +57 -0
- data/lib/discordrb/permissions.rb +103 -8
- data/lib/discordrb/version.rb +1 -1
- data/lib/discordrb/voice/encoder.rb +16 -7
- data/lib/discordrb/voice/network.rb +84 -43
- data/lib/discordrb/voice/sodium.rb +96 -0
- data/lib/discordrb/voice/voice_bot.rb +34 -26
- data/lib/discordrb.rb +73 -0
- metadata +98 -60
- /data/{CONTRIBUTING.md → .github/CONTRIBUTING.md} +0 -0
@@ -6,7 +6,7 @@ require 'discordrb/logger'
|
|
6
6
|
|
7
7
|
# Voice support
|
8
8
|
module Discordrb::Voice
|
9
|
-
# How long one voice packet should ideally be (
|
9
|
+
# How long one voice packet should ideally be (20ms as defined by Discord)
|
10
10
|
IDEAL_LENGTH = 20.0
|
11
11
|
|
12
12
|
# How many bytes of data to read (1920 bytes * 2 channels) from audio PCM data
|
@@ -22,7 +22,10 @@ module Discordrb::Voice
|
|
22
22
|
# {VoiceBot#adjust_offset}, and {VoiceBot#adjust_average}.
|
23
23
|
class VoiceBot
|
24
24
|
# @return [Channel] the current voice channel
|
25
|
-
attr_reader :channel
|
25
|
+
attr_reader :channel # rubocop:disable Style/BisectedAttrAccessor
|
26
|
+
|
27
|
+
# @!visibility private
|
28
|
+
attr_writer :channel # rubocop:disable Style/BisectedAttrAccessor
|
26
29
|
|
27
30
|
# @return [Integer, nil] the amount of time the stream has been playing, or `nil` if nothing has been played yet.
|
28
31
|
attr_reader :stream_time
|
@@ -36,7 +39,7 @@ module Discordrb::Voice
|
|
36
39
|
# play parts back too fast. How often these measurements should be done depends a lot on the system, and if it's
|
37
40
|
# done too quickly, especially on slow connections, the playback speed will vary wildly; if it's done too slowly
|
38
41
|
# however, small errors will cause quality problems for a longer time.
|
39
|
-
# @return [Integer] how frequently audio length adjustments should be done, in ideal packets (
|
42
|
+
# @return [Integer] how frequently audio length adjustments should be done, in ideal packets (20ms).
|
40
43
|
attr_accessor :adjust_interval
|
41
44
|
|
42
45
|
# This particular value is also important because ffmpeg may take longer to process the first few packets. It is
|
@@ -44,7 +47,7 @@ module Discordrb::Voice
|
|
44
47
|
# shouldn't be any higher than {#adjust_interval}, otherwise no adjustments will take place. If {#adjust_interval}
|
45
48
|
# is at a value higher than 10, this value should not be changed at all.
|
46
49
|
# @see #adjust_interval
|
47
|
-
# @return [Integer] the packet number (1 packet =
|
50
|
+
# @return [Integer] the packet number (1 packet = 20ms) at which length adjustments should start.
|
48
51
|
attr_accessor :adjust_offset
|
49
52
|
|
50
53
|
# This value determines whether or not the adjustment length should be averaged with the previous value. This may
|
@@ -60,8 +63,8 @@ module Discordrb::Voice
|
|
60
63
|
attr_accessor :adjust_debug
|
61
64
|
|
62
65
|
# If this value is set, no length adjustments will ever be done and this value will always be used as the length
|
63
|
-
# (i.
|
64
|
-
# The ideal length is
|
66
|
+
# (i.e. packets will be sent every N seconds). Be careful not to set it too low as to not spam Discord's servers.
|
67
|
+
# The ideal length is 20ms (accessible by the {Discordrb::Voice::IDEAL_LENGTH} constant), this value should be
|
65
68
|
# slightly lower than that because encoding + sending takes time. Note that sending DCA files is significantly
|
66
69
|
# faster than sending regular audio files (usually about four times as fast), so you might want to set this value
|
67
70
|
# to something else if you're sending a DCA file.
|
@@ -74,13 +77,12 @@ module Discordrb::Voice
|
|
74
77
|
attr_accessor :volume
|
75
78
|
|
76
79
|
# @!visibility private
|
77
|
-
def initialize(channel, bot, token, session, endpoint
|
80
|
+
def initialize(channel, bot, token, session, endpoint)
|
78
81
|
@bot = bot
|
79
82
|
@channel = channel
|
80
83
|
|
81
84
|
@ws = VoiceWS.new(channel, bot, token, session, endpoint)
|
82
85
|
@udp = @ws.udp
|
83
|
-
@udp.encrypted = encrypted
|
84
86
|
|
85
87
|
@sequence = @time = 0
|
86
88
|
@skips = 0
|
@@ -95,14 +97,15 @@ module Discordrb::Voice
|
|
95
97
|
|
96
98
|
@encoder = Encoder.new
|
97
99
|
@ws.connect
|
98
|
-
rescue => e
|
100
|
+
rescue StandardError => e
|
99
101
|
Discordrb::LOGGER.log_exception(e)
|
100
102
|
raise
|
101
103
|
end
|
102
104
|
|
103
105
|
# @return [true, false] whether audio data sent will be encrypted.
|
106
|
+
# @deprecated Discord no longer supports unencrypted voice communication.
|
104
107
|
def encrypted?
|
105
|
-
|
108
|
+
true
|
106
109
|
end
|
107
110
|
|
108
111
|
# Set the filter volume. This volume is applied as a filter for decoded audio data. It has the advantage that using
|
@@ -132,7 +135,7 @@ module Discordrb::Voice
|
|
132
135
|
|
133
136
|
alias_method :isplaying?, :playing?
|
134
137
|
|
135
|
-
# Continue playback. This change may take up to
|
138
|
+
# Continue playback. This change may take up to 100ms to take effect, which is usually negligible.
|
136
139
|
def continue
|
137
140
|
@paused = false
|
138
141
|
end
|
@@ -145,7 +148,8 @@ module Discordrb::Voice
|
|
145
148
|
end
|
146
149
|
|
147
150
|
# Sets whether or not the bot is speaking (green circle around user).
|
148
|
-
# @param value [true, false] whether or not the bot should be speaking
|
151
|
+
# @param value [true, false, Integer] whether or not the bot should be speaking, or a bitmask denoting the audio type
|
152
|
+
# @note https://discordapp.com/developers/docs/topics/voice-connections#speaking for information on the speaking bitmask
|
149
153
|
def speaking=(value)
|
150
154
|
@playing = value
|
151
155
|
@ws.send_speaking(value)
|
@@ -161,6 +165,7 @@ module Discordrb::Voice
|
|
161
165
|
sleep IDEAL_LENGTH / 1000.0 if @was_playing_before
|
162
166
|
|
163
167
|
return unless wait_for_confirmation
|
168
|
+
|
164
169
|
@has_stopped_playing = false
|
165
170
|
sleep IDEAL_LENGTH / 1000.0 until @has_stopped_playing
|
166
171
|
@has_stopped_playing = false
|
@@ -173,7 +178,7 @@ module Discordrb::Voice
|
|
173
178
|
@ws.destroy
|
174
179
|
end
|
175
180
|
|
176
|
-
# Plays a stream of raw data to the channel. All playback methods are blocking, i.
|
181
|
+
# Plays a stream of raw data to the channel. All playback methods are blocking, i.e. they wait for the playback to
|
177
182
|
# finish before exiting the method. This doesn't cause a problem if you just use discordrb events/commands to
|
178
183
|
# play stuff, as these are fully threaded, but if you don't want this behaviour anyway, be sure to call these
|
179
184
|
# methods in separate threads.
|
@@ -206,7 +211,7 @@ module Discordrb::Voice
|
|
206
211
|
end
|
207
212
|
|
208
213
|
# Adjust volume
|
209
|
-
buf = @encoder.adjust_volume(buf, @volume) if @volume != 1.0
|
214
|
+
buf = @encoder.adjust_volume(buf, @volume) if @volume != 1.0 # rubocop:disable Lint/FloatComparison
|
210
215
|
|
211
216
|
@first_packet = false
|
212
217
|
|
@@ -215,12 +220,15 @@ module Discordrb::Voice
|
|
215
220
|
end
|
216
221
|
|
217
222
|
# If the stream is a process, kill it
|
218
|
-
if encoded_io
|
223
|
+
if encoded_io&.pid
|
219
224
|
Discordrb::LOGGER.debug("Killing ffmpeg process with pid #{encoded_io.pid.inspect}")
|
220
225
|
|
221
226
|
begin
|
222
|
-
|
223
|
-
|
227
|
+
pid = encoded_io.pid
|
228
|
+
# Windows does not support TERM as a kill signal, so we use KILL. `Process.waitpid` verifies that our
|
229
|
+
# child process has not already completed.
|
230
|
+
Process.kill(Gem.win_platform? ? 'KILL' : 'TERM', pid) if Process.waitpid(pid, Process::WNOHANG).nil?
|
231
|
+
rescue StandardError => e
|
224
232
|
Discordrb::LOGGER.warn('Failed to kill ffmpeg process! You *might* have a process leak now.')
|
225
233
|
Discordrb::LOGGER.warn("Reason: #{e}")
|
226
234
|
end
|
@@ -255,13 +263,13 @@ module Discordrb::Voice
|
|
255
263
|
stop_playing(true) if @playing
|
256
264
|
|
257
265
|
@bot.debug "Reading DCA file #{file}"
|
258
|
-
input_stream = open(file)
|
266
|
+
input_stream = File.open(file)
|
259
267
|
|
260
268
|
magic = input_stream.read(4)
|
261
269
|
raise ArgumentError, 'Not a DCA1 file! The file might have been corrupted, please recreate it.' unless magic == 'DCA1'
|
262
270
|
|
263
271
|
# Read the metadata header, then read the metadata and discard it as we don't care about it
|
264
|
-
metadata_header = input_stream.read(4).
|
272
|
+
metadata_header = input_stream.read(4).unpack1('l<')
|
265
273
|
input_stream.read(metadata_header)
|
266
274
|
|
267
275
|
# Play the data, without re-encoding it to opus
|
@@ -275,9 +283,9 @@ module Discordrb::Voice
|
|
275
283
|
next :stop
|
276
284
|
end
|
277
285
|
|
278
|
-
header = header_str.
|
286
|
+
header = header_str.unpack1('s<')
|
279
287
|
|
280
|
-
raise 'Negative header in DCA file! Your file is likely corrupted.' if header
|
288
|
+
raise 'Negative header in DCA file! Your file is likely corrupted.' if header.negative?
|
281
289
|
rescue EOFError
|
282
290
|
@bot.debug 'Finished DCA parsing (EOFError)'
|
283
291
|
next :stop
|
@@ -292,7 +300,7 @@ module Discordrb::Voice
|
|
292
300
|
|
293
301
|
private
|
294
302
|
|
295
|
-
# Plays the data from the
|
303
|
+
# Plays the data from the IO stream as Discord requires it
|
296
304
|
def play_internal
|
297
305
|
count = 0
|
298
306
|
@playing = true
|
@@ -311,7 +319,7 @@ module Discordrb::Voice
|
|
311
319
|
break unless @playing
|
312
320
|
|
313
321
|
# If we should skip, get some data, discard it and go to the next iteration
|
314
|
-
if @skips
|
322
|
+
if @skips.positive?
|
315
323
|
@skips -= 1
|
316
324
|
yield
|
317
325
|
next
|
@@ -364,7 +372,7 @@ module Discordrb::Voice
|
|
364
372
|
# If paused, wait
|
365
373
|
sleep 0.1 while @paused
|
366
374
|
|
367
|
-
if @length
|
375
|
+
if @length.positive?
|
368
376
|
# Wait `length` ms, then send the next packet
|
369
377
|
sleep @length / 1000.0
|
370
378
|
else
|
@@ -378,13 +386,13 @@ module Discordrb::Voice
|
|
378
386
|
increment_packet_headers
|
379
387
|
@udp.send_audio(Encoder::OPUS_SILENCE, @sequence, @time)
|
380
388
|
|
381
|
-
# Length adjustments don't matter here, we can just wait
|
389
|
+
# Length adjustments don't matter here, we can just wait 20ms since nobody is going to hear it anyway
|
382
390
|
sleep IDEAL_LENGTH / 1000.0
|
383
391
|
end
|
384
392
|
|
385
393
|
@bot.debug('Performing final cleanup after stream ended')
|
386
394
|
|
387
|
-
# Final
|
395
|
+
# Final clean-up
|
388
396
|
stop_playing
|
389
397
|
|
390
398
|
# Notify any stop_playing methods running right now that we have actually stopped
|
data/lib/discordrb.rb
CHANGED
@@ -11,6 +11,79 @@ module Discordrb
|
|
11
11
|
|
12
12
|
# The default debug logger used by discordrb.
|
13
13
|
LOGGER = Logger.new(ENV['DISCORDRB_FANCY_LOG'])
|
14
|
+
|
15
|
+
# The Unix timestamp Discord IDs are based on
|
16
|
+
DISCORD_EPOCH = 1_420_070_400_000
|
17
|
+
|
18
|
+
# Used to declare what events you wish to recieve from Discord.
|
19
|
+
# @see https://discordapp.com/developers/docs/topics/gateway#gateway-intents
|
20
|
+
INTENTS = {
|
21
|
+
servers: 1 << 0,
|
22
|
+
server_members: 1 << 1,
|
23
|
+
server_bans: 1 << 2,
|
24
|
+
server_emojis: 1 << 3,
|
25
|
+
server_integrations: 1 << 4,
|
26
|
+
server_webhooks: 1 << 5,
|
27
|
+
server_invites: 1 << 6,
|
28
|
+
server_voice_states: 1 << 7,
|
29
|
+
server_presences: 1 << 8,
|
30
|
+
server_messages: 1 << 9,
|
31
|
+
server_message_reactions: 1 << 10,
|
32
|
+
server_message_typing: 1 << 11,
|
33
|
+
direct_messages: 1 << 12,
|
34
|
+
direct_message_reactions: 1 << 13,
|
35
|
+
direct_message_typing: 1 << 14
|
36
|
+
}.freeze
|
37
|
+
|
38
|
+
# @return [Integer] All available intents
|
39
|
+
ALL_INTENTS = INTENTS.values.reduce(&:|)
|
40
|
+
|
41
|
+
# Compares two objects based on IDs - either the objects' IDs are equal, or one object is equal to the other's ID.
|
42
|
+
def self.id_compare(one_id, other)
|
43
|
+
other.respond_to?(:resolve_id) ? (one_id.resolve_id == other.resolve_id) : (one_id == other)
|
44
|
+
end
|
45
|
+
|
46
|
+
# The maximum length a Discord message can have
|
47
|
+
CHARACTER_LIMIT = 2000
|
48
|
+
|
49
|
+
# Splits a message into chunks of 2000 characters. Attempts to split by lines if possible.
|
50
|
+
# @param msg [String] The message to split.
|
51
|
+
# @return [Array<String>] the message split into chunks
|
52
|
+
def self.split_message(msg)
|
53
|
+
# If the messages is empty, return an empty array
|
54
|
+
return [] if msg.empty?
|
55
|
+
|
56
|
+
# Split the message into lines
|
57
|
+
lines = msg.lines
|
58
|
+
|
59
|
+
# Turn the message into a "triangle" of consecutively longer slices, for example the array [1,2,3,4] would become
|
60
|
+
# [
|
61
|
+
# [1],
|
62
|
+
# [1, 2],
|
63
|
+
# [1, 2, 3],
|
64
|
+
# [1, 2, 3, 4]
|
65
|
+
# ]
|
66
|
+
tri = (0...lines.length).map { |i| lines.combination(i + 1).first }
|
67
|
+
|
68
|
+
# Join the individual elements together to get an array of strings with consecutively more lines
|
69
|
+
joined = tri.map(&:join)
|
70
|
+
|
71
|
+
# Find the largest element that is still below the character limit, or if none such element exists return the first
|
72
|
+
ideal = joined.max_by { |e| e.length > CHARACTER_LIMIT ? -1 : e.length }
|
73
|
+
|
74
|
+
# If it's still larger than the character limit (none was smaller than it) split it into the largest chunk without
|
75
|
+
# cutting words apart, breaking on the nearest space within character limit, otherwise just return an array with one element
|
76
|
+
ideal_ary = ideal.length > CHARACTER_LIMIT ? ideal.split(/(.{1,#{CHARACTER_LIMIT}}\b|.{1,#{CHARACTER_LIMIT}})/o).reject(&:empty?) : [ideal]
|
77
|
+
|
78
|
+
# Slice off the ideal part and strip newlines
|
79
|
+
rest = msg[ideal.length..-1].strip
|
80
|
+
|
81
|
+
# If none remains, return an empty array -> we're done
|
82
|
+
return [] unless rest
|
83
|
+
|
84
|
+
# Otherwise, call the method recursively to split the rest of the string and add it onto the ideal array
|
85
|
+
ideal_ary + split_message(rest)
|
86
|
+
end
|
14
87
|
end
|
15
88
|
|
16
89
|
# In discordrb, Integer and {String} are monkey-patched to allow for easy resolution of IDs
|
metadata
CHANGED
@@ -1,29 +1,30 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: discordrb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.3
|
4
|
+
version: 3.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- meew0
|
8
|
-
|
8
|
+
- swarley
|
9
|
+
autorequire:
|
9
10
|
bindir: exe
|
10
11
|
cert_chain: []
|
11
|
-
date:
|
12
|
+
date: 2023-07-05 00:00:00.000000000 Z
|
12
13
|
dependencies:
|
13
14
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
15
|
+
name: ffi
|
15
16
|
requirement: !ruby/object:Gem::Requirement
|
16
17
|
requirements:
|
17
18
|
- - ">="
|
18
19
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
20
|
+
version: 1.9.24
|
20
21
|
type: :runtime
|
21
22
|
prerelease: false
|
22
23
|
version_requirements: !ruby/object:Gem::Requirement
|
23
24
|
requirements:
|
24
25
|
- - ">="
|
25
26
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
27
|
+
version: 1.9.24
|
27
28
|
- !ruby/object:Gem::Dependency
|
28
29
|
name: opus-ruby
|
29
30
|
requirement: !ruby/object:Gem::Requirement
|
@@ -39,181 +40,192 @@ dependencies:
|
|
39
40
|
- !ruby/object:Gem::Version
|
40
41
|
version: '0'
|
41
42
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
43
|
+
name: rest-client
|
43
44
|
requirement: !ruby/object:Gem::Requirement
|
44
45
|
requirements:
|
45
46
|
- - ">="
|
46
47
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0.
|
48
|
+
version: 2.0.0
|
48
49
|
type: :runtime
|
49
50
|
prerelease: false
|
50
51
|
version_requirements: !ruby/object:Gem::Requirement
|
51
52
|
requirements:
|
52
53
|
- - ">="
|
53
54
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0.
|
55
|
+
version: 2.0.0
|
55
56
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - "~>"
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: 3.4.0
|
62
|
-
type: :runtime
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - "~>"
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: 3.4.0
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: ffi
|
57
|
+
name: websocket-client-simple
|
71
58
|
requirement: !ruby/object:Gem::Requirement
|
72
59
|
requirements:
|
73
60
|
- - ">="
|
74
61
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
62
|
+
version: 0.3.0
|
76
63
|
type: :runtime
|
77
64
|
prerelease: false
|
78
65
|
version_requirements: !ruby/object:Gem::Requirement
|
79
66
|
requirements:
|
80
67
|
- - ">="
|
81
68
|
- !ruby/object:Gem::Version
|
82
|
-
version:
|
69
|
+
version: 0.3.0
|
83
70
|
- !ruby/object:Gem::Dependency
|
84
71
|
name: discordrb-webhooks
|
85
72
|
requirement: !ruby/object:Gem::Requirement
|
86
73
|
requirements:
|
87
74
|
- - "~>"
|
88
75
|
- !ruby/object:Gem::Version
|
89
|
-
version: 3.3
|
76
|
+
version: 3.4.3
|
90
77
|
type: :runtime
|
91
78
|
prerelease: false
|
92
79
|
version_requirements: !ruby/object:Gem::Requirement
|
93
80
|
requirements:
|
94
81
|
- - "~>"
|
95
82
|
- !ruby/object:Gem::Version
|
96
|
-
version: 3.3
|
83
|
+
version: 3.4.3
|
97
84
|
- !ruby/object:Gem::Dependency
|
98
85
|
name: bundler
|
99
86
|
requirement: !ruby/object:Gem::Requirement
|
100
87
|
requirements:
|
101
|
-
- - "
|
88
|
+
- - ">="
|
102
89
|
- !ruby/object:Gem::Version
|
103
90
|
version: '1.10'
|
91
|
+
- - "<"
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '3'
|
104
94
|
type: :development
|
105
95
|
prerelease: false
|
106
96
|
version_requirements: !ruby/object:Gem::Requirement
|
107
97
|
requirements:
|
108
|
-
- - "
|
98
|
+
- - ">="
|
109
99
|
- !ruby/object:Gem::Version
|
110
100
|
version: '1.10'
|
101
|
+
- - "<"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '3'
|
111
104
|
- !ruby/object:Gem::Dependency
|
112
105
|
name: rake
|
113
106
|
requirement: !ruby/object:Gem::Requirement
|
114
107
|
requirements:
|
115
108
|
- - "~>"
|
116
109
|
- !ruby/object:Gem::Version
|
117
|
-
version: '
|
110
|
+
version: '13.0'
|
118
111
|
type: :development
|
119
112
|
prerelease: false
|
120
113
|
version_requirements: !ruby/object:Gem::Requirement
|
121
114
|
requirements:
|
122
115
|
- - "~>"
|
123
116
|
- !ruby/object:Gem::Version
|
124
|
-
version: '
|
117
|
+
version: '13.0'
|
125
118
|
- !ruby/object:Gem::Dependency
|
126
|
-
name:
|
119
|
+
name: redcarpet
|
127
120
|
requirement: !ruby/object:Gem::Requirement
|
128
121
|
requirements:
|
129
122
|
- - "~>"
|
130
123
|
- !ruby/object:Gem::Version
|
131
|
-
version:
|
124
|
+
version: 3.5.0
|
132
125
|
type: :development
|
133
126
|
prerelease: false
|
134
127
|
version_requirements: !ruby/object:Gem::Requirement
|
135
128
|
requirements:
|
136
129
|
- - "~>"
|
137
130
|
- !ruby/object:Gem::Version
|
138
|
-
version:
|
131
|
+
version: 3.5.0
|
139
132
|
- !ruby/object:Gem::Dependency
|
140
|
-
name:
|
133
|
+
name: rspec
|
141
134
|
requirement: !ruby/object:Gem::Requirement
|
142
135
|
requirements:
|
143
136
|
- - "~>"
|
144
137
|
- !ruby/object:Gem::Version
|
145
|
-
version: 3.
|
138
|
+
version: 3.10.0
|
146
139
|
type: :development
|
147
140
|
prerelease: false
|
148
141
|
version_requirements: !ruby/object:Gem::Requirement
|
149
142
|
requirements:
|
150
143
|
- - "~>"
|
151
144
|
- !ruby/object:Gem::Version
|
152
|
-
version: 3.
|
145
|
+
version: 3.10.0
|
153
146
|
- !ruby/object:Gem::Dependency
|
154
|
-
name: rspec
|
147
|
+
name: rspec-prof
|
155
148
|
requirement: !ruby/object:Gem::Requirement
|
156
149
|
requirements:
|
157
150
|
- - "~>"
|
158
151
|
- !ruby/object:Gem::Version
|
159
|
-
version:
|
152
|
+
version: 0.0.7
|
160
153
|
type: :development
|
161
154
|
prerelease: false
|
162
155
|
version_requirements: !ruby/object:Gem::Requirement
|
163
156
|
requirements:
|
164
157
|
- - "~>"
|
165
158
|
- !ruby/object:Gem::Version
|
166
|
-
version:
|
159
|
+
version: 0.0.7
|
167
160
|
- !ruby/object:Gem::Dependency
|
168
|
-
name:
|
161
|
+
name: rubocop
|
169
162
|
requirement: !ruby/object:Gem::Requirement
|
170
163
|
requirements:
|
171
164
|
- - "~>"
|
172
165
|
- !ruby/object:Gem::Version
|
173
|
-
version:
|
166
|
+
version: 1.4.0
|
174
167
|
type: :development
|
175
168
|
prerelease: false
|
176
169
|
version_requirements: !ruby/object:Gem::Requirement
|
177
170
|
requirements:
|
178
171
|
- - "~>"
|
179
172
|
- !ruby/object:Gem::Version
|
180
|
-
version:
|
173
|
+
version: 1.4.0
|
181
174
|
- !ruby/object:Gem::Dependency
|
182
|
-
name: rubocop
|
175
|
+
name: rubocop-performance
|
183
176
|
requirement: !ruby/object:Gem::Requirement
|
184
177
|
requirements:
|
185
|
-
- -
|
178
|
+
- - "~>"
|
186
179
|
- !ruby/object:Gem::Version
|
187
|
-
version: 0
|
180
|
+
version: '1.0'
|
188
181
|
type: :development
|
189
182
|
prerelease: false
|
190
183
|
version_requirements: !ruby/object:Gem::Requirement
|
191
184
|
requirements:
|
192
|
-
- -
|
185
|
+
- - "~>"
|
193
186
|
- !ruby/object:Gem::Version
|
194
|
-
version: 0
|
187
|
+
version: '1.0'
|
195
188
|
- !ruby/object:Gem::Dependency
|
196
189
|
name: simplecov
|
197
190
|
requirement: !ruby/object:Gem::Requirement
|
198
191
|
requirements:
|
199
192
|
- - "~>"
|
200
193
|
- !ruby/object:Gem::Version
|
201
|
-
version: 0.
|
194
|
+
version: 0.19.0
|
202
195
|
type: :development
|
203
196
|
prerelease: false
|
204
197
|
version_requirements: !ruby/object:Gem::Requirement
|
205
198
|
requirements:
|
206
199
|
- - "~>"
|
207
200
|
- !ruby/object:Gem::Version
|
208
|
-
version: 0.
|
209
|
-
|
201
|
+
version: 0.19.0
|
202
|
+
- !ruby/object:Gem::Dependency
|
203
|
+
name: yard
|
204
|
+
requirement: !ruby/object:Gem::Requirement
|
205
|
+
requirements:
|
206
|
+
- - "~>"
|
207
|
+
- !ruby/object:Gem::Version
|
208
|
+
version: 0.9.9
|
209
|
+
type: :development
|
210
|
+
prerelease: false
|
211
|
+
version_requirements: !ruby/object:Gem::Requirement
|
212
|
+
requirements:
|
213
|
+
- - "~>"
|
214
|
+
- !ruby/object:Gem::Version
|
215
|
+
version: 0.9.9
|
216
|
+
description: A Ruby implementation of the Discord (https://discord.com) API.
|
210
217
|
email:
|
211
218
|
- ''
|
212
219
|
executables: []
|
213
220
|
extensions: []
|
214
221
|
extra_rdoc_files: []
|
215
222
|
files:
|
223
|
+
- ".circleci/config.yml"
|
216
224
|
- ".codeclimate.yml"
|
225
|
+
- ".github/CONTRIBUTING.md"
|
226
|
+
- ".github/ISSUE_TEMPLATE/bug_report.md"
|
227
|
+
- ".github/ISSUE_TEMPLATE/feature_request.md"
|
228
|
+
- ".github/pull_request_template.md"
|
217
229
|
- ".gitignore"
|
218
230
|
- ".overcommit.yml"
|
219
231
|
- ".rspec"
|
@@ -221,7 +233,6 @@ files:
|
|
221
233
|
- ".travis.yml"
|
222
234
|
- ".yardopts"
|
223
235
|
- CHANGELOG.md
|
224
|
-
- CONTRIBUTING.md
|
225
236
|
- Gemfile
|
226
237
|
- LICENSE.txt
|
227
238
|
- README.md
|
@@ -232,6 +243,7 @@ files:
|
|
232
243
|
- discordrb-webhooks.gemspec
|
233
244
|
- discordrb.gemspec
|
234
245
|
- lib/discordrb.rb
|
246
|
+
- lib/discordrb/allowed_mentions.rb
|
235
247
|
- lib/discordrb/api.rb
|
236
248
|
- lib/discordrb/api/channel.rb
|
237
249
|
- lib/discordrb/api/invite.rb
|
@@ -241,6 +253,7 @@ files:
|
|
241
253
|
- lib/discordrb/await.rb
|
242
254
|
- lib/discordrb/bot.rb
|
243
255
|
- lib/discordrb/cache.rb
|
256
|
+
- lib/discordrb/colour_rgb.rb
|
244
257
|
- lib/discordrb/commands/command_bot.rb
|
245
258
|
- lib/discordrb/commands/container.rb
|
246
259
|
- lib/discordrb/commands/events.rb
|
@@ -248,12 +261,34 @@ files:
|
|
248
261
|
- lib/discordrb/commands/rate_limiter.rb
|
249
262
|
- lib/discordrb/container.rb
|
250
263
|
- lib/discordrb/data.rb
|
264
|
+
- lib/discordrb/data/activity.rb
|
265
|
+
- lib/discordrb/data/application.rb
|
266
|
+
- lib/discordrb/data/attachment.rb
|
267
|
+
- lib/discordrb/data/audit_logs.rb
|
268
|
+
- lib/discordrb/data/channel.rb
|
269
|
+
- lib/discordrb/data/embed.rb
|
270
|
+
- lib/discordrb/data/emoji.rb
|
271
|
+
- lib/discordrb/data/integration.rb
|
272
|
+
- lib/discordrb/data/invite.rb
|
273
|
+
- lib/discordrb/data/member.rb
|
274
|
+
- lib/discordrb/data/message.rb
|
275
|
+
- lib/discordrb/data/overwrite.rb
|
276
|
+
- lib/discordrb/data/profile.rb
|
277
|
+
- lib/discordrb/data/reaction.rb
|
278
|
+
- lib/discordrb/data/recipient.rb
|
279
|
+
- lib/discordrb/data/role.rb
|
280
|
+
- lib/discordrb/data/server.rb
|
281
|
+
- lib/discordrb/data/user.rb
|
282
|
+
- lib/discordrb/data/voice_region.rb
|
283
|
+
- lib/discordrb/data/voice_state.rb
|
284
|
+
- lib/discordrb/data/webhook.rb
|
251
285
|
- lib/discordrb/errors.rb
|
252
286
|
- lib/discordrb/events/await.rb
|
253
287
|
- lib/discordrb/events/bans.rb
|
254
288
|
- lib/discordrb/events/channels.rb
|
255
289
|
- lib/discordrb/events/generic.rb
|
256
290
|
- lib/discordrb/events/guilds.rb
|
291
|
+
- lib/discordrb/events/invites.rb
|
257
292
|
- lib/discordrb/events/lifetime.rb
|
258
293
|
- lib/discordrb/events/members.rb
|
259
294
|
- lib/discordrb/events/message.rb
|
@@ -262,27 +297,31 @@ files:
|
|
262
297
|
- lib/discordrb/events/reactions.rb
|
263
298
|
- lib/discordrb/events/roles.rb
|
264
299
|
- lib/discordrb/events/typing.rb
|
300
|
+
- lib/discordrb/events/voice_server_update.rb
|
265
301
|
- lib/discordrb/events/voice_state_update.rb
|
266
302
|
- lib/discordrb/events/webhooks.rb
|
267
303
|
- lib/discordrb/gateway.rb
|
304
|
+
- lib/discordrb/id_object.rb
|
268
305
|
- lib/discordrb/light.rb
|
269
306
|
- lib/discordrb/light/data.rb
|
270
307
|
- lib/discordrb/light/integrations.rb
|
271
308
|
- lib/discordrb/light/light_bot.rb
|
272
309
|
- lib/discordrb/logger.rb
|
310
|
+
- lib/discordrb/paginator.rb
|
273
311
|
- lib/discordrb/permissions.rb
|
274
312
|
- lib/discordrb/version.rb
|
275
313
|
- lib/discordrb/voice/encoder.rb
|
276
314
|
- lib/discordrb/voice/network.rb
|
315
|
+
- lib/discordrb/voice/sodium.rb
|
277
316
|
- lib/discordrb/voice/voice_bot.rb
|
278
317
|
- lib/discordrb/webhooks.rb
|
279
318
|
- lib/discordrb/websocket.rb
|
280
|
-
homepage: https://github.com/
|
319
|
+
homepage: https://github.com/shardlab/discordrb
|
281
320
|
licenses:
|
282
321
|
- MIT
|
283
322
|
metadata:
|
284
|
-
changelog_uri: https://github.com/
|
285
|
-
post_install_message:
|
323
|
+
changelog_uri: https://github.com/shardlab/discordrb/blob/master/CHANGELOG.md
|
324
|
+
post_install_message:
|
286
325
|
rdoc_options: []
|
287
326
|
require_paths:
|
288
327
|
- lib
|
@@ -290,16 +329,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
290
329
|
requirements:
|
291
330
|
- - ">="
|
292
331
|
- !ruby/object:Gem::Version
|
293
|
-
version: 2.
|
332
|
+
version: '2.5'
|
294
333
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
295
334
|
requirements:
|
296
335
|
- - ">="
|
297
336
|
- !ruby/object:Gem::Version
|
298
337
|
version: '0'
|
299
338
|
requirements: []
|
300
|
-
|
301
|
-
|
302
|
-
signing_key:
|
339
|
+
rubygems_version: 3.3.3
|
340
|
+
signing_key:
|
303
341
|
specification_version: 4
|
304
342
|
summary: Discord API for Ruby
|
305
343
|
test_files: []
|
File without changes
|