summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Gerus <arachnist@i.am-a.cat>2014-04-28 13:05:32 +0200
committerRobert Gerus <arachnist@i.am-a.cat>2014-04-28 13:05:32 +0200
commit8d963bcd620b00709c31f5db65441bc63b924594 (patch)
treeb851d4aa2625f7bef5e2781f8a44ebb47ee98148
parent6ab55a865b094d008e0292701328f5a698f5a807 (diff)
downloadrepost-8d963bcd620b00709c31f5db65441bc63b924594.tar.gz
repost-8d963bcd620b00709c31f5db65441bc63b924594.tar.bz2
repost-8d963bcd620b00709c31f5db65441bc63b924594.tar.xz
repost-8d963bcd620b00709c31f5db65441bc63b924594.zip
yaaaay.
-rw-r--r--plugins/commands/jan.rb19
1 files 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 " "
}