discordrb 1.0.6 → 1.0.7

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: 2296feb0a038652aa89be29c52175bc0f11eaf34
4
- data.tar.gz: 6ddb6b25676a6c62c337a90cbd353f3f8657ef09
3
+ metadata.gz: f2b9aba77d10f1d0b341c8e8f7c9e8c5a25de3ad
4
+ data.tar.gz: 49a423d60940fbcdef970ef097fab403a9eb581d
5
5
  SHA512:
6
- metadata.gz: b15a87221c8c796400ddff8689c324a8fb554855b268fda56d45bfce7ac1513897647bc22bb939fd9fb140598a5d7739e3f74b35166263210c579d9c368b02da
7
- data.tar.gz: 520abf9af895c57671e502f0294e7aa23baa4c5cdda02d410d4dc050055870f84d06677e9b93418b17ab4c30cb696ecb91d18eb6731d0fdec66fa1cf26e07587
6
+ metadata.gz: 83b12c85e6b6362e91f81b287dcf1df3a12a421c96f9be0dda091f6ae2e1b9cf0188518a56c5b7bce0c4b1321695ce1df7dfa1f01f3de642d8769ddcb8da914e
7
+ data.tar.gz: 08e3f4188e7380e189756af5f97e848059d53a15c1c24a2d327d96ab61694620a03dfc70b1f04ad85855428c9bf10be5d13eabeda47673a8e7f3c27d2802c44d
data/lib/discordrb/bot.rb CHANGED
@@ -43,8 +43,8 @@ module Discordrb
43
43
  while true do
44
44
  @token = login
45
45
  websocket_connect
46
- puts "disconnected. attempting to reconnect."
47
- sleep 5
46
+ puts "disconnected. attempting to reconnect. " + Time.now
47
+ sleep 2
48
48
  end
49
49
  end
50
50
 
@@ -144,10 +144,10 @@ module Discordrb
144
144
 
145
145
  debug("Received token: #{login_response_object['token']}")
146
146
  login_response_object['token']
147
- rescue SocketError => e
148
- if login_attempts < 100 && e.inspect.include?("No such host is known.")
147
+ rescue Exception => e
148
+ if login_attempts < 100 && ( e.inspect.include?("No such host is known.") || login_response.code == 523)
149
149
  sleep 15
150
- puts "login failed. reattempting."
150
+ puts "login failed. reattempting. " + Time.now.to_s
151
151
  login_attempts = login_attempts + 1
152
152
  retry
153
153
  else
@@ -4,19 +4,17 @@ module Discordrb::Events
4
4
  class MessageEvent
5
5
  attr_reader :message
6
6
 
7
+ delegate :author, :channel, :content, :timestamp, to: :message
8
+
7
9
  def initialize(message, bot)
8
10
  @bot = bot
9
11
  @message = message
10
12
  end
11
13
 
12
- def author; @message.author; end
14
+ def send_message(content); @message.channel.send_message(content); end
15
+
13
16
  alias_method :user, :author
14
- def channel; @message.channel; end
15
- def content; @message.content; end
16
17
  alias_method :text, :content
17
- def timestamp; @message.timestamp; end
18
-
19
- def send_message(content); @message.channel.send_message(content); end
20
18
  alias_method :send, :send_message
21
19
  alias_method :respond, :send_message
22
20
  end
@@ -1,3 +1,3 @@
1
1
  module Discordrb
2
- VERSION = "1.0.6"
2
+ VERSION = "1.0.7"
3
3
  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.0.6
4
+ version: 1.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - meew0
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-09-02 00:00:00.000000000 Z
11
+ date: 2015-09-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faye-websocket
@@ -115,7 +115,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
115
115
  version: '0'
116
116
  requirements: []
117
117
  rubyforge_project:
118
- rubygems_version: 2.4.5
118
+ rubygems_version: 2.4.5.1
119
119
  signing_key:
120
120
  specification_version: 4
121
121
  summary: Discord API for Ruby