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 +4 -4
- data/lib/discordrb/bot.rb +5 -5
- data/lib/discordrb/events/message.rb +4 -6
- data/lib/discordrb/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f2b9aba77d10f1d0b341c8e8f7c9e8c5a25de3ad
|
4
|
+
data.tar.gz: 49a423d60940fbcdef970ef097fab403a9eb581d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
|
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
|
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
|
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.0.
|
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-
|
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
|