discordrb 1.6.0 → 1.6.1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of discordrb might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -2
- data/README.md +1 -1
- data/lib/discordrb/bot.rb +11 -2
- data/lib/discordrb/token_cache.rb +5 -0
- data/lib/discordrb/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7009f9cbbf7e9d6a5709b2d61974701415e3cccb
|
4
|
+
data.tar.gz: 1ad6505964d3eded7e1b6475d9834dfb89e22f57
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9d6807c55b095159bc6f277f996642d26e8e573e01692d62f14c3cd0da20194ffc3d28f6551d842d09d3520565a5d13af68404ec11189f9bc473dce4a4dfab9d
|
7
|
+
data.tar.gz: 169218a43d0b2a6796ca831dbbdff72a6fb869d8143b2b66b0e6b25e8035497e8052d903ac90bbd6f254c7670b04e1ef1c30a73771bb28963db91f0fa6983038
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 1.6.1
|
4
|
+
* It's now possible to prevent the `READY` packet from being printed in debug mode, run `bot.suppress_ready_debug` once before the `bot.run` to do it.
|
5
|
+
|
6
|
+
### Bugfixes
|
7
|
+
* Token cache files with invalid JSON syntax will no longer crash the bot at login.
|
8
|
+
|
3
9
|
## 1.6.0
|
4
10
|
|
5
11
|
* The inline documentation using YARD was greatly improved and is now mostly usable, at least for the data classes and voice classes. It's still not complete enough to be released on GitHub, but you can build it yourself using [YARD](http://yardoc.org/).
|
@@ -10,12 +16,12 @@
|
|
10
16
|
* The events `bot.message_edit` and `bot.message_delete` are now available for message editing and deletion. Note that Discord doesn't provide the content of edited/deleted messages, so you'll have to implement message caching yourself if you really need it.
|
11
17
|
* The events `bot.user_ban` and `bot.user_unban` are now available for users getting banned/unbanned from servers.
|
12
18
|
* A bot's name can now be sent using `bot.name=`. This data will be sent to Discord with the user-agent and it might be used for cool statistics in the future.
|
13
|
-
* Discord server ownership transfer is now implemented using the writer `server.owner=`.
|
19
|
+
* Discord server ownership transfer is now implemented using the writer `server.owner=`. (#41)
|
14
20
|
* `CommandBot`s can now have command aliases by simply using an array of symbols as the command name.
|
15
21
|
* A utility method `server.default_channel` was implemented that returns the default text channel of a server, usually called #general. (An alias `general_channel` is available too.)
|
16
22
|
* Tokens will no longer appear in debug output, so you're safe sending output logs to other people.
|
17
23
|
* A reader `server.owner` that returns the server's owner as a `User` was added. Previously, users had to manually get the `User` object using `bot.user`.
|
18
|
-
* Most methods that accept IDs or data objects now also accept `Integer`s or `String`s containing the IDs now. This is implemented by adding a method `resolve_id` to all objects that could potentially contain an ID. (Note that this change is not complete yet and I might have missed some methods.)
|
24
|
+
* Most methods that accept IDs or data objects now also accept `Integer`s or `String`s containing the IDs now. This is implemented by adding a method `resolve_id` to all objects that could potentially contain an ID. (Note that this change is not complete yet and I might have missed some methods.) (#40)
|
19
25
|
* The writer `server.afk_channel_id=` is now deprecated as its functionality is now covered by `server.afk_channel=`.
|
20
26
|
* A new reader `user.avatar_url` was added that returns the full image URL to a user's avatar.
|
21
27
|
* To avoid confusion with `avatar_url`, the reader `user.avatar` was renamed to `avatar_id`. (`user.avatar` still exists but is now deprecated.)
|
data/README.md
CHANGED
@@ -44,7 +44,7 @@ Then reinstall discordrb:
|
|
44
44
|
terminate called after throwing an instance of 'std::runtime_error'
|
45
45
|
what(): Encryption not available on this event-machine
|
46
46
|
|
47
|
-
You're missing the OpenSSL libraries that EventMachine, a dependency of discordrb, needs to be built with to use encrypted connections (which Discord requires). Download the OpenSSL libraries from [here](https://slproweb.com/download/Win32OpenSSL-
|
47
|
+
You're missing the OpenSSL libraries that EventMachine, a dependency of discordrb, needs to be built with to use encrypted connections (which Discord requires). Download the OpenSSL libraries from [here](https://slproweb.com/download/Win32OpenSSL-1_0_2f.exe), install them to their default location and reinstall EventMachine using these libraries:
|
48
48
|
|
49
49
|
gem uninstall eventmachine
|
50
50
|
gem install eventmachine -- --with-ssl-dir=C:/OpenSSL-Win32
|
data/lib/discordrb/bot.rb
CHANGED
@@ -444,6 +444,11 @@ module Discordrb
|
|
444
444
|
LOGGER.debug = new_debug
|
445
445
|
end
|
446
446
|
|
447
|
+
# Prevents the READY packet from being printed regardless of debug mode.
|
448
|
+
def suppress_ready_debug
|
449
|
+
@prevent_ready = true
|
450
|
+
end
|
451
|
+
|
447
452
|
## ## ### ## ## ######## ## ######## ######## ######
|
448
453
|
## ## ## ## ### ## ## ## ## ## ## ## ## ##
|
449
454
|
## ## ## ## #### ## ## ## ## ## ## ## ##
|
@@ -936,11 +941,15 @@ module Discordrb
|
|
936
941
|
end
|
937
942
|
|
938
943
|
def websocket_message(event)
|
939
|
-
debug("Received packet #{event.data}")
|
940
|
-
|
941
944
|
# Parse packet
|
942
945
|
packet = JSON.parse(event.data)
|
943
946
|
|
947
|
+
if @prevent_ready && packet['t'] == 'READY'
|
948
|
+
debug('READY packet was received and suppressed')
|
949
|
+
else
|
950
|
+
debug("Received packet #{event.data}")
|
951
|
+
end
|
952
|
+
|
944
953
|
fail 'Invalid Packet' unless packet['op'] == 0 # TODO
|
945
954
|
|
946
955
|
data = packet['d']
|
@@ -91,6 +91,11 @@ module Discordrb
|
|
91
91
|
LOGGER.debug("Cache file #{CACHE_PATH} not found. Using empty cache")
|
92
92
|
@data = {}
|
93
93
|
end
|
94
|
+
rescue => e
|
95
|
+
LOGGER.debug('Exception occurred while parsing token cache file:', true)
|
96
|
+
LOGGER.log_exception(e)
|
97
|
+
LOGGER.debug('Continuing with empty cache')
|
98
|
+
@data = {}
|
94
99
|
end
|
95
100
|
|
96
101
|
def token(email, password)
|
data/lib/discordrb/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: discordrb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.
|
4
|
+
version: 1.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- meew0
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-02-
|
11
|
+
date: 2016-02-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faye-websocket
|