Download:
child 19:fade59cdf584
parent 17:20b47f01a71d
18:7cf8ac0d3ebc
Anton Shestakov <av6@dwimlabs.net>, Fri, 03 Jun 2016 11:23:45 +0800
rollbot: only roll things with at least 2 sides and do it at least once

1 файлов изменено, 3 вставок(+), 2 удалений(-) [+]
rollbot.py file | annotate | diff | comparison | revisions
--- a/rollbot.py Sun May 22 21:48:18 2016 +0800
+++ b/rollbot.py Fri Jun 03 11:23:45 2016 +0800
@@ -39,8 +39,9 @@
if times is None:
times = 1
sides = match.group('sides')
- rolls, total = self.roll(int(times), int(sides))
- return self.format(rolls, total)
+ if times > 0 and sides > 1:
+ rolls, total = self.roll(int(times), int(sides))
+ return self.format(rolls, total)
return '%s usage: %s' % (self.name, self.usage())