lita-discord_oauth 0.1.1.alpha.26 → 0.1.1.alpha.27
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/lita/adapters/discord_oauth.rb +13 -15
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dafe1b1fe5e75075daa1721d27ea0b8227aacb04
|
4
|
+
data.tar.gz: 74b3a32a6a158ca9a19b41c914b13a259cdd843e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1b2704a52e6430ade66aae946cc1410b753f85423faa065163f726aeb9db3a4f452d06791670160f3fc2c2d9decfcbf0ffafb485e58c647bbfb18e52995fcac7
|
7
|
+
data.tar.gz: 2d85db7967792cbe8d794885cda6e41cbebf443718dba1492a0aa844fe2cc100009851f0d2bae93b196807f6a6a555f430e60b98e1946fc47210488a7a5b9608
|
@@ -13,30 +13,28 @@ module Lita
|
|
13
13
|
|
14
14
|
def run
|
15
15
|
STDOUT.write('Starting')
|
16
|
-
@client.ready do |
|
16
|
+
@client.ready do |e|
|
17
17
|
robot.trigger(:connected)
|
18
|
-
STDOUT.write('Connected to Discord')
|
19
|
-
end
|
20
|
-
|
21
|
-
@client.message do |event|
|
22
|
-
message = event.message
|
23
|
-
message_text = message.content
|
24
18
|
|
25
|
-
|
26
|
-
|
19
|
+
@client.message do |event|
|
20
|
+
message = event.message
|
21
|
+
message_text = message.content
|
27
22
|
|
28
|
-
|
23
|
+
user = Lita::User.find_by_id(message.author.id)
|
24
|
+
user = Lita::User.create(user) unless user
|
29
25
|
|
30
|
-
|
31
|
-
msg = Lita::Message.new(robot, message_text, source)
|
26
|
+
channel = event.channel.id
|
32
27
|
|
33
|
-
|
28
|
+
source = Lita::Source.new(user: user, room: channel)
|
29
|
+
msg = Lita::Message.new(robot, message_text, source)
|
34
30
|
|
35
|
-
|
31
|
+
robot.receive(msg) #unless message.from_bot?
|
36
32
|
|
33
|
+
end
|
37
34
|
end
|
38
35
|
|
39
|
-
|
36
|
+
|
37
|
+
@client.run
|
40
38
|
end
|
41
39
|
|
42
40
|
def shut_down
|