This commit is contained in:
Robert Gerus 2014-04-28 13:05:32 +02:00
parent 6ab55a865b
commit 8d963bcd62

View file

@ -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 " "
}