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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 83611585f04b5691290e1cd20dfe3bdb79e1a7e5
4
- data.tar.gz: 0bee0f46686f1ab83bed2bc29475abacfd63a7a4
3
+ metadata.gz: 93042e81bb196d3eef785859717aeefe1b33824c
4
+ data.tar.gz: aeb1ce23ee900334b0084fdb11ec21bba1d06905
5
5
  SHA512:
6
- metadata.gz: c5026c77c36c3793179c681e55f03f442861f1db163355d87e8945db8521035b2836f5cec0969e7d091cb580aa1d9d57aaa52ac55cc5cf76a4b4a8d9341f51ee
7
- data.tar.gz: 1bb5dc73917f3b01ace47d16ed2646876364a7135166f346d7bed31d025344d5413c5558b0aa5f6508eb811f15e24eb1bb0c47e4a3a3c1fc1a68ac59104fe2f9
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
- author_name = message.author.display_name.to_s
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)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lita-discord_oauth
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2.alpha.50
4
+ version: 0.1.2.alpha.51
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cas Eliëns