summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/DDate.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/modules/DDate.rb b/modules/DDate.rb
new file mode 100644
index 0000000..1402648
--- /dev/null
+++ b/modules/DDate.rb
@@ -0,0 +1,19 @@
+require 'xmpp4r/message'
+
+require_relative '../module_base'
+
+module Lain
+ module Modules
+ class DDate < Base
+ def on_message(muc, message)
+ 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
+ end
+ end
+ end
+end