turntabler 0.1.2 → 0.1.3
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.
- data/CHANGELOG.md +4 -0
- data/README.md +1 -1
- data/examples/Gemfile.lock +1 -1
- data/examples/bop.rb +1 -1
- data/examples/bopcount.rb +1 -1
- data/examples/chat_bot.rb +1 -1
- data/examples/modlist.rb +1 -1
- data/examples/switch.rb +2 -2
- data/lib/turntabler/room.rb +3 -3
- data/lib/turntabler/user.rb +1 -0
- data/lib/turntabler/version.rb +1 -1
- metadata +4 -4
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
data/examples/Gemfile.lock
CHANGED
data/examples/bop.rb
CHANGED
data/examples/bopcount.rb
CHANGED
data/examples/chat_bot.rb
CHANGED
@@ -9,7 +9,7 @@ ROOM = ENV['ROOM'] # 'xxxxxxxxxxxxxxxxxxxxxxxx'
|
|
9
9
|
TT.run(EMAIL, PASSWORD, :room => ROOM) do
|
10
10
|
on :user_spoke do |message|
|
11
11
|
# Respond to "/hello" command
|
12
|
-
if (message.
|
12
|
+
if (message.content =~ /^\/hello$/)
|
13
13
|
client.user.say("Hey! How are you @#{message.sender.name}?")
|
14
14
|
end
|
15
15
|
end
|
data/examples/modlist.rb
CHANGED
@@ -12,7 +12,7 @@ moderator_ids = ['xxxxxxxxxxxxxxxxxxxxxxxx', 'xxxxxxxxxxxxxxxxxxxxxxxx']
|
|
12
12
|
TT.run(EMAIL, PASSWORD, :room => ROOM) do
|
13
13
|
on :user_spoke do |message|
|
14
14
|
# Response to "/mod" command
|
15
|
-
if moderator_ids.include?(message.sender.id) && message.
|
15
|
+
if moderator_ids.include?(message.sender.id) && message.content =~ /^\/mod$/
|
16
16
|
user.say("Yo #{message.sender.name}, it looks like you are a bot moderator!")
|
17
17
|
end
|
18
18
|
end
|
data/examples/switch.rb
CHANGED
@@ -13,7 +13,7 @@ TT.run(EMAIL, PASSWORD, :room => ROOM) do
|
|
13
13
|
on :user_spoke do |message|
|
14
14
|
if is_on
|
15
15
|
# The bot is on
|
16
|
-
case message.
|
16
|
+
case message.content
|
17
17
|
when /^\/status$/
|
18
18
|
user.say 'The bot is currently turned on.'
|
19
19
|
when /^\/off$/
|
@@ -26,7 +26,7 @@ TT.run(EMAIL, PASSWORD, :room => ROOM) do
|
|
26
26
|
end
|
27
27
|
else
|
28
28
|
# The bot is off
|
29
|
-
case message.
|
29
|
+
case message.content
|
30
30
|
when /^\/status$/
|
31
31
|
user.say 'The bot is currently turned on.'
|
32
32
|
when /^\/on$/
|
data/lib/turntabler/room.rb
CHANGED
@@ -349,14 +349,14 @@ module Turntabler
|
|
349
349
|
|
350
350
|
# Braodcasts a message in the chat.
|
351
351
|
#
|
352
|
-
# @param [String]
|
352
|
+
# @param [String] content The text to send to the chat
|
353
353
|
# @return [true]
|
354
354
|
# @raise [Turntabler::Error] if the command fails
|
355
355
|
# @example
|
356
356
|
# room.say("What's up guys?") # => true
|
357
|
-
def say(
|
357
|
+
def say(content)
|
358
358
|
enter
|
359
|
-
api('room.speak', :text =>
|
359
|
+
api('room.speak', :text => content)
|
360
360
|
true
|
361
361
|
end
|
362
362
|
|
data/lib/turntabler/user.rb
CHANGED
data/lib/turntabler/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: turntabler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 29
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 3
|
10
|
+
version: 0.1.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Aaron Pfeifer
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-12-
|
18
|
+
date: 2012-12-25 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: em-synchrony
|