summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/Credits.rb17
-rw-r--r--modules/DDate.rb5
2 files changed, 18 insertions, 4 deletions
diff --git a/modules/Credits.rb b/modules/Credits.rb
new file mode 100644
index 0000000..e0289e4
--- /dev/null
+++ b/modules/Credits.rb
@@ -0,0 +1,17 @@
+# -*- coding: utf-8 -*-
+require 'xmpp4r/message'
+
+require_relative '../module_base'
+
+module Lain
+ module Modules
+ class Credits < Base
+ def on_message(muc, message)
+ return unless message.type == :groupchat
+ return unless /!credits\b/ =~ message.body
+
+ muc.send(Jabber::Message.new(message.to, "Lain (レイン) #{Version}\n\n -- hacked by NeoRaider"))
+ end
+ end
+ end
+end
diff --git a/modules/DDate.rb b/modules/DDate.rb
index 1402648..af9912e 100644
--- a/modules/DDate.rb
+++ b/modules/DDate.rb
@@ -9,10 +9,7 @@ module Lain
return unless message.type == :groupchat
return unless /!ddate\b/ =~ message.body
- p = IO.popen("ddate")
- while (line = p.gets)
- muc.send(Jabber::Message.new(message.to, line.chomp))
- end
+ muc.send(Jabber::Message.new(message.to, IO.popen("ddate").gets(sep=nil).chomp))
end
end
end