feature/98-timeout-command-2 (#306)
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
- Prevent user from trying to time out a bot - Update time length input to ignore commas #98 Co-authored-by: Ethan Lane <ethan@vylpes.com> Reviewed-on: https://gitea.vylpes.xyz/RabbitLabs/vylbot-app/pulls/306
This commit is contained in:
parent
eb774aa280
commit
400b4de304
5 changed files with 50 additions and 2 deletions
|
@ -35,4 +35,8 @@ export default class StringTools {
|
|||
|
||||
return result;
|
||||
}
|
||||
|
||||
public static ReplaceAll(str: string, find: string, replace: string) {
|
||||
return str.replace(new RegExp(find, 'g'), replace);
|
||||
}
|
||||
}
|
|
@ -1,8 +1,10 @@
|
|||
import StringTools from "./StringTools";
|
||||
|
||||
export default class TimeLengthInput {
|
||||
public readonly value: string;
|
||||
|
||||
constructor(input: string) {
|
||||
this.value = input;
|
||||
this.value = StringTools.ReplaceAll(input, ',', '');
|
||||
}
|
||||
|
||||
public GetDays(): number {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue