[RUtil] Fix bug in !rand caused when a > b

master
Sfan5 2013-08-14 12:59:48 +02:00
parent 8fff77c58b
commit 5813fa757f
1 changed files with 5 additions and 0 deletions

View File

@ -262,6 +262,11 @@ def rand(phenny, input):
b = int(arg.split(" ")[1]) + 1
except ValueError:
return phenny.reply("Could not parse argument 2")
if b < a:
tmp = a
a = b
b = tmp
del tmp
phenny.say(str(random.randrange(a, b)))
else:
try: