Skip to content

Commit 3157002

Browse files
authored
Fix off by 1 in /roll
/roll misused randint and suffered from a possible off by 1
1 parent d09ca5d commit 3157002

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pybot/endpoints/slack/commands.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ async def slash_roll(command: Command, app: SirBot):
150150
)
151151
return await slack.query(methods.CHAT_POST_EPHEMERAL, response)
152152

153-
dice = [random.randint(1, typedice + 1) for _ in range(numdice)]
153+
dice = [random.randint(1, typedice) for _ in range(numdice)]
154154
message = f"<@{slack_id}> Rolled {numdice} D{typedice}: {dice}"
155155
response = dict(channel=channel_id, text=message)
156156
await slack.query(methods.CHAT_POST_MESSAGE, response)

0 commit comments

Comments
 (0)