lita-resistance 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +32 -18
- data/lib/lita/handlers/resistance.rb +9 -1
- data/lita-resistance.gemspec +1 -1
- 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: e01368713992622db461d4cf9e9f401754e2fa40
|
4
|
+
data.tar.gz: 93708f06b073f98346f90318a4c4c93c5a097d69
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bc04e890e9a9aa6674f28baf91e80e26c284a7089e96cbda06f3fe36af7b96ea14687f2bda593b9a4f29808667b63555355666e640d1f8c8f7d9fdfc7f32681b
|
7
|
+
data.tar.gz: bd50d1ed8d33ab0f6c1c9ddb106dbb2d818051b426bb0ad29264761a7d542c0bc0d8531fbc0e47ed87c04e40f117c426c8c93587cecb033e1641277910292a18
|
data/README.md
CHANGED
@@ -1,18 +1,32 @@
|
|
1
|
-
# lita-resistance
|
2
|
-
|
3
|
-
[![Build Status](https://travis-ci.org/DeonHua/lita-resistance.png?branch=master)](https://travis-ci.org/DeonHua/lita-resistance)
|
4
|
-
[![Coverage Status](https://coveralls.io/repos/DeonHua/lita-resistance/badge.png)](https://coveralls.io/r/DeonHua/lita-resistance)
|
5
|
-
|
6
|
-
Plays a game of resistance by assigning roles to users you mention in chat.
|
7
|
-
|
8
|
-
## Installation
|
9
|
-
|
10
|
-
Add lita-resistance to your Lita instance's Gemfile:
|
11
|
-
|
12
|
-
``` ruby
|
13
|
-
gem "lita-resistance"
|
14
|
-
```
|
15
|
-
|
16
|
-
## Usage
|
17
|
-
|
18
|
-
`lita resistance [users]` - Assigns the roles of spy/resistance to users you mention.
|
1
|
+
# lita-resistance
|
2
|
+
|
3
|
+
[![Build Status](https://travis-ci.org/DeonHua/lita-resistance.png?branch=master)](https://travis-ci.org/DeonHua/lita-resistance)
|
4
|
+
[![Coverage Status](https://coveralls.io/repos/DeonHua/lita-resistance/badge.png)](https://coveralls.io/r/DeonHua/lita-resistance)
|
5
|
+
|
6
|
+
Plays a game of resistance by assigning roles to users you mention in chat.
|
7
|
+
|
8
|
+
## Installation
|
9
|
+
|
10
|
+
Add lita-resistance to your Lita instance's Gemfile:
|
11
|
+
|
12
|
+
``` ruby
|
13
|
+
gem "lita-resistance"
|
14
|
+
```
|
15
|
+
|
16
|
+
## Usage
|
17
|
+
|
18
|
+
`lita resistance [users]` - Assigns the roles of spy/resistance to users you mention.
|
19
|
+
|
20
|
+
### Examples
|
21
|
+
|
22
|
+
`lita resistance @player1 @player2 @player3 @player4 @player5`
|
23
|
+
|
24
|
+
You don't need to include the `@` symbol:
|
25
|
+
|
26
|
+
`lita resistance player1 player2 player3 player4 player5`
|
27
|
+
|
28
|
+
You can also do a combination of both:
|
29
|
+
|
30
|
+
`lita resistance @player1 @player2 player3 player4 player5`
|
31
|
+
|
32
|
+
[![forthebadge](http://forthebadge.com/images/badges/built-with-love.svg)](http://forthebadge.com)
|
@@ -45,7 +45,15 @@ module Lita
|
|
45
45
|
|
46
46
|
spies.each do |member|
|
47
47
|
user = Lita::User.find_by_mention_name(member)
|
48
|
-
|
48
|
+
current_user = Source.new(user: user)
|
49
|
+
robot.send_message(current_user,"@#{response.user.mention_name} has started game ID ##{gameId} of Resistance. You are a member of the spies.")
|
50
|
+
other_spies = spies.dup
|
51
|
+
other_spies.delete_at(other_spies.find_index(member))
|
52
|
+
if other_spies.length > 1
|
53
|
+
robot.send_message(current_user, "The other spies are: @#{other_spies.join(' @')}")
|
54
|
+
else
|
55
|
+
robot.send_message(current_user, "The other spy is: @#{other_spies[0]}")
|
56
|
+
end
|
49
57
|
end
|
50
58
|
|
51
59
|
resistance.each do |member|
|
data/lita-resistance.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |spec|
|
2
2
|
spec.name = "lita-resistance"
|
3
|
-
spec.version = "0.2.
|
3
|
+
spec.version = "0.2.1"
|
4
4
|
spec.authors = ["Deon Hua", "Yu Chen Hou"]
|
5
5
|
spec.email = ["deonhbci@gmail.com", "me@yuchen.io"]
|
6
6
|
spec.description = "Plays a game of resistance by assigning roles to users you mention in chat."
|