Improve diceroll looks, implement limits to avoid abuse
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Lorenzo Dellacà
2022-12-19 17:30:47 +01:00
parent 495f164552
commit 1a19a9ea06
4 changed files with 57 additions and 5 deletions

View File

@@ -44,6 +44,9 @@ public class ClearCommand extends SlashCommandImpl
OptionMapping amountOption = event.getOption("amount");
int toDeleteAmount = amountOption == null ? 1 : amountOption.getAsInt();
// cap the amount to avoid abuse.
if(toDeleteAmount > ClearChat.getMaxAmount()) toDeleteAmount = 0;
error = ClearChat.checkDeleteAmount(toDeleteAmount);
if(error != null)
{