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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8f012d4df7d5f6beac41402044ddc9f597aef8b7
4
- data.tar.gz: 1b75879a95b4be99a0faef8617e1b019c3b7bb81
3
+ metadata.gz: 7009f9cbbf7e9d6a5709b2d61974701415e3cccb
4
+ data.tar.gz: 1ad6505964d3eded7e1b6475d9834dfb89e22f57
5
5
  SHA512:
6
- metadata.gz: eb0e782b340e2fa53f2b93618594332f2b8c0025cad5756072f9792786f0f79c9768e0938cd934f2c289ec36edd8025c6c6e90e15dbe98a36e20eb82d09a5bf3
7
- data.tar.gz: 4d75ececf380101a0f7dd9b3e8f748c658446f0b54d5a5f19fbadc4aa6edc7c9671174723ea792d56527b60c21c4543c0ef69fc822630a930331d4fb63c0e5b4
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-1_0_2e.exe), install them to their default location and reinstall EventMachine using these libraries:
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)
@@ -1,5 +1,5 @@
1
1
  # Discordrb and all its functionality, in this case only the version.
2
2
  module Discordrb
3
3
  # The current version of discordrb.
4
- VERSION = '1.6.0'.freeze
4
+ VERSION = '1.6.1'.freeze
5
5
  end
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.0
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-01 00:00:00.000000000 Z
11
+ date: 2016-02-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faye-websocket