summaryrefslogtreecommitdiffstats
path: root/modules/Fortune.rb
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2013-01-02 01:13:29 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2013-01-02 01:13:29 +0100
commitdceabdbb7ede39694ecac9e71b36124e4123e741 (patch)
tree9fbab4f2f8971baa741521cf6e7ad70b267f0ba4 /modules/Fortune.rb
parent09e925d6956cd7431a3466d8b659a7207e029617 (diff)
downloadlain-dceabdbb7ede39694ecac9e71b36124e4123e741.tar
lain-dceabdbb7ede39694ecac9e71b36124e4123e741.zip
Add command help
Diffstat (limited to 'modules/Fortune.rb')
-rw-r--r--modules/Fortune.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/modules/Fortune.rb b/modules/Fortune.rb
index 2b9d63b..f8b237a 100644
--- a/modules/Fortune.rb
+++ b/modules/Fortune.rb
@@ -9,7 +9,13 @@ module Lain
return unless message.type == :groupchat
return unless /!fortune\b/ =~ message.body
- muc.send(Jabber::Message.new(message.to, IO.popen(@config['command']).gets(sep=nil).chomp))
+ muc.send(Jabber::Message.new(message.to, "\n" + IO.popen(@config['command']).read.chomp))
+ end
+
+ def commands
+ {
+ '!fortune' => 'fortune cookies'
+ }
end
end
end