lita-discord_oauth 0.1.2.alpha.50 → 0.1.2.alpha.51
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 +11 -4
- 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: 93042e81bb196d3eef785859717aeefe1b33824c
|
4
|
+
data.tar.gz: aeb1ce23ee900334b0084fdb11ec21bba1d06905
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 571d240338b8d761d9bea62879f60c05e6b1a4b37231a7da291f9d4fa981faccdce18748ecf4746d5cdd60c3f915f1fc4f9c8aefd0f7386ca3e372fdf342e6c2
|
7
|
+
data.tar.gz: cf2597d8b0aeaf19c1effc18f9e0956a1b2b746da4f514d428ee226f4e9a6329b35e0086943188309903599b74746fc560d81c0e65f2be441be6c3950bccb34b
|
@@ -22,8 +22,18 @@ module Lita
|
|
22
22
|
|
23
23
|
@client.message do |event|
|
24
24
|
message = event.message
|
25
|
+
channel = event.channel.id.to_s
|
25
26
|
author_id = message.author.id.to_s
|
26
|
-
|
27
|
+
|
28
|
+
if event.channel.pm?
|
29
|
+
# We're dealing with a PM
|
30
|
+
author_name = message.author.username.to_s
|
31
|
+
else
|
32
|
+
# We're dealing with a regular (server) message
|
33
|
+
author_name = message.author.display_name.to_s
|
34
|
+
end
|
35
|
+
|
36
|
+
|
27
37
|
|
28
38
|
Lita.logger.debug("Received message from #{author_name}(#{author_id}): #{message.content}")
|
29
39
|
Lita.logger.debug("Finding user #{author_name}")
|
@@ -44,9 +54,6 @@ module Lita
|
|
44
54
|
end
|
45
55
|
|
46
56
|
Lita.logger.debug('User ID: ' + user.id)
|
47
|
-
|
48
|
-
channel = event.channel.id.to_s
|
49
|
-
|
50
57
|
Lita.logger.debug('Channel ID: ' + channel)
|
51
58
|
|
52
59
|
source = Lita::Source.new(user: user, room: channel)
|