mirror of
https://github.com/jcreek/denBot.git
synced 2026-07-13 02:43:46 +00:00
fix(*): Padd generated code with leading zeros
This commit is contained in:
@@ -53,7 +53,8 @@ function generateRandomCode() {
|
||||
const num1 = Math.floor((Math.random() * 9999) + 1);
|
||||
const num2 = Math.floor((Math.random() * 9999) + 1);
|
||||
|
||||
return `${num1}-${num2}`;
|
||||
// Pad the start of the numbers so there's always four digits, including leading zeros
|
||||
return `${num1.toString().padStart(4, '0')}-${num2.toString().padStart(4, '0')}`;
|
||||
}
|
||||
|
||||
function checkQueue(message) {
|
||||
|
||||
Reference in New Issue
Block a user