Fix .quote not actually working

master
Marrub 2017-08-09 06:00:31 -04:00
parent ddfa488140
commit 8b308fdd7c
1 changed files with 1 additions and 0 deletions

View File

@ -63,6 +63,7 @@ class Mod_Fun < Vrobot4::Module::Module
def c_quote m, argv
argv = argv.join(" ")
if argv.length == 0
max = JSON.parse(open(QDB + "/interface.cgi").read)["numQuotes"]
m.reply_b open(QDB + "/q/" + (rand(max) + 1).to_s).read
elsif Vrobot4.is_num? argv
m.reply_b open(QDB + "/q/" + argv.to_i.to_s).read