Class: BubBot::Slack::Command::List
Class Method Summary
collapse
Instance Method Summary
collapse
can_handle?, #initialize
Class Method Details
.aliases ⇒ Object
7
8
9
|
# File 'lib/bub_bot/slack/commands/list.rb', line 7
def self.aliases
%w(list status all wazup)
end
|
Instance Method Details
#run ⇒ Object
11
12
13
14
15
16
17
18
19
20
21
22
|
# File 'lib/bub_bot/slack/commands/list.rb', line 11
def run
list_strings = servers.list.map do |server, claim|
if claim['expires_at']
time_ago = time_ago_in_words(claim['expires_at'])
"#{server}: *#{claim['user']}'s* for the next #{time_ago}"
else
"#{server}: *free*"
end
end
respond(list_strings.join("\n"))
end
|