mirror of
https://github.com/MrDetonia/Maki.git
synced 2024-11-22 20:00:00 -05:00
v0.16.4 fixed limits on .roll
This commit is contained in:
parent
e672513d33
commit
6cd8f27d36
6
bot.py
6
bot.py
@ -33,7 +33,7 @@ from secret import token
|
|||||||
name = "Maki"
|
name = "Maki"
|
||||||
|
|
||||||
# bot version
|
# bot version
|
||||||
version = "v0.16.3"
|
version = "v0.16.4"
|
||||||
|
|
||||||
# text shown by .help command
|
# text shown by .help command
|
||||||
helptext = """I am a bot written in Python by MrDetonia
|
helptext = """I am a bot written in Python by MrDetonia
|
||||||
@ -215,6 +215,8 @@ def on_message(message):
|
|||||||
nums = [int(s) for s in re.findall(r'\d+', message.content)]
|
nums = [int(s) for s in re.findall(r'\d+', message.content)]
|
||||||
|
|
||||||
# limit range
|
# limit range
|
||||||
|
if nums[0] < 1: nums[0] = 1
|
||||||
|
if nums[1] < 1: nums[1] = 1
|
||||||
if nums[0] > 100: nums[0] = 100
|
if nums[0] > 100: nums[0] = 100
|
||||||
if nums[1] > 1000000: nums[1] = 1000000
|
if nums[1] > 1000000: nums[1] = 1000000
|
||||||
|
|
||||||
@ -223,7 +225,7 @@ def on_message(message):
|
|||||||
for i in range(nums[0]):
|
for i in range(nums[0]):
|
||||||
rollsum += random.randint(1, nums[1])
|
rollsum += random.randint(1, nums[1])
|
||||||
|
|
||||||
response = 'You rolled: ' + str(rollsum)
|
response = 'Using ' + str(nums[0]) + 'd' + str(nums[1]) + ' you rolled: ' + str(rollsum)
|
||||||
else:
|
else:
|
||||||
response = 'you did it wrong!'
|
response = 'you did it wrong!'
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user