Really fix parsing bug
This commit is contained in:
parent
7959ac54da
commit
15a0361083
@ -282,6 +282,13 @@ impl Bot {
|
||||
let max = word
|
||||
.parse::<u64>()
|
||||
.map_err(|error| format!("Failed to parse integer: {error}"))?;
|
||||
|
||||
if max <= 1 {
|
||||
return Err(
|
||||
"Roll command did not receive an integer greater than 1".to_string()
|
||||
);
|
||||
}
|
||||
|
||||
let random = thread_rng().gen_range(1..max);
|
||||
|
||||
match message.chat_type {
|
||||
|
Loading…
Reference in New Issue
Block a user