From dceabdbb7ede39694ecac9e71b36124e4123e741 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 2 Jan 2013 01:13:29 +0100 Subject: Add command help --- modules/Fortune.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'modules/Fortune.rb') 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 -- cgit v1.2.3