From 8d963bcd620b00709c31f5db65441bc63b924594 Mon Sep 17 00:00:00 2001 From: Robert Gerus Date: Mon, 28 Apr 2014 13:05:32 +0200 Subject: [PATCH] yaaaay. --- plugins/commands/jan.rb | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/plugins/commands/jan.rb b/plugins/commands/jan.rb index 716fe51..2e76b2c 100644 --- a/plugins/commands/jan.rb +++ b/plugins/commands/jan.rb @@ -1,8 +1,21 @@ -Client.register_command("jan") { |args| +Client.register_command("jantest") { |args| + if not args[0].nil? then + if args[0].force_encoding("UTF-8") =~ /ał$/ then + predicate = args[0] + object = File.readlines(Config[:commands][:jan][:object]).sample.strip + else + predicate = File.readlines(Config[:commands][:jan][:predicates]).sample.strip + object = args[0] + end + else + object = File.readlines(Config[:commands][:jan][:object]).sample.strip + predicate = File.readlines(Config[:commands][:jan][:predicates]).sample.strip + end + [ Config[:commands][:jan][:subject], - File.readlines(Config[:commands][:jan][:predicates]).sample.strip, + predicate, Config[:commands][:jan][:attribute], - File.readlines(Config[:commands][:jan][:object]).sample.strip + object ].join " " }