repost/plugins/commands/jan.rb
Robert Gerus 6b0d4e41a5 hmm…
2014-04-28 15:00:14 +02:00

21 lines
713 B
Ruby

Client.register_command("jan") { |args|
if not args[0].nil? then
if args[0].force_encoding("UTF-8") =~ /ł$/ 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],
predicate,
Config[:commands][:jan][:attribute],
object
].join " "
}