lita-isolita 0.1.4 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 04ad787d04e590f8a0ba561cfaadcfc3ae35753c
4
- data.tar.gz: cd26753e5364bdb7db276709fd92aa1dbbb5169f
3
+ metadata.gz: 74c2e268b9a1c9f8caf0107ac463cd69cefb330b
4
+ data.tar.gz: 688ade5c7f33a5952763bc9117f19afdba9da8b2
5
5
  SHA512:
6
- metadata.gz: 768032d53130553e15133bac0a1d69c70c895938f45ef3169baabf31021ec653ccc34e9463745e0cd0a8b132f1322dbbddd374cb8fd12c1d5c957bb0e2990d31
7
- data.tar.gz: b182080052c2a7767107604cc6cd818dbdcdb521e262c2037bd905c07354d47eba31748348cf735175e3de5846da2c3446e023821e415824d026724080b53f8f
6
+ metadata.gz: a442b5cdf3837fe5938a484ad77241be2aad9074aa779a64ba2552ae0df54e0f2b8a67c97ec5c6dd92ed06af171dcef22c1d8e41eadeed600d821143d4d63765
7
+ data.tar.gz: 409b9df9396e9ee61e7c9d776c92dfbe396a03bf85cda9f4ee009d9ec25eef7b80759a6cfb8fa2df0d2b4edf32fa95923d2da81ff1e6340270bc7426b5436853
@@ -1,14 +1,24 @@
1
1
  module Lita
2
2
  module Handlers
3
3
  class Isolita < Handler
4
- route(/^(fuck).*/i, :mind_your_manners, help: {
5
- "Fuck you" => "Advises to clean up your language."
6
- })
7
4
 
8
- def mind_your_manners(response)
5
+ ## Get the username for who's talking to Lita.
6
+ def get_reply_to_name(response)
9
7
  reply_to_name = response.user.metadata['mention_name'].nil? ?
10
8
  "#{response.user.name}" :
11
9
  "#{response.user.metadata['mention_name']}"
10
+ end
11
+
12
+
13
+ ## Mind your manners will just focus on "Fuck"
14
+ ## for now until others become a problem.
15
+ route(/fuck/i, :mind_your_manners, help: {
16
+ "lita: fuck you" => "Advises to clean up your language after saying `fuck`"
17
+ })
18
+
19
+ def mind_your_manners(response)
20
+ get_reply_to_name(response)
21
+
12
22
  mind_manners = [
13
23
  "Mind your manners #{reply_to_name}..",
14
24
  "You better wash out that dirty mouth #{reply_to_name}!",
@@ -22,12 +32,14 @@ module Lita
22
32
  response.reply mind_manners.sample
23
33
  end
24
34
 
35
+
36
+
25
37
  route(/^(show response json).*/i, :print_reply, help: {
26
- "show response json" => "Prints out bot response in json"
38
+ "show response json" => "Prints out Lita's response"
27
39
  })
28
40
 
29
41
  def print_reply(response)
30
- response.reply_privately response
42
+ response.reply_privately "#{response.user}"
31
43
  end
32
44
 
33
45
  end
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "lita-isolita"
3
- spec.version = "0.1.4"
3
+ spec.version = "0.1.5"
4
4
  spec.authors = ["Chris Mikelson"]
5
5
  spec.email = ["chrismikelson@gmail.com"]
6
6
  spec.description = "Make Lita do more work"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lita-isolita
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Mikelson