mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 22:16:40 +00:00
feat(resources): set number as keytype for Players map
This commit is contained in:
1 parent
a424a67f05
commit
de53b12763
2 files changed
+3
-9
No files matched your search
@@ -18,7 +18,7 @@ interface Credentials {
|
||||
phone_number: string;
|
||||
}
|
||||
|
||||
export const Players = new Map<string, IPlayer>();
|
||||
export const Players = new Map<number, IPlayer>();
|
||||
|
||||
// gets the identifers
|
||||
on('playerJoining', async () => {
|
||||
@@ -29,8 +29,6 @@ on('playerJoining', async () => {
|
||||
const identifers = getPlayerIdentifiers(pSource);
|
||||
identifier = identifers[1].split(':')[1];
|
||||
|
||||
console.log('PHONE IS READY: ', identifier);
|
||||
|
||||
if (!identifier) {
|
||||
throw new Error('Identifier could not be found.');
|
||||
}
|
||||
@@ -60,7 +58,7 @@ function getRandomPhoneNumber() {
|
||||
} else {
|
||||
randomNumber = Math.floor(Math.random() * 10000000)
|
||||
.toString()
|
||||
.replace(/(\d{3})(\d{4})/, '$1-$2'); // ;
|
||||
.replace(/(\d{3})(\d{4})/, '$1-$2');
|
||||
// The numbers inside {} in replace() can be changed to how many digits you want on each side of the dash.
|
||||
// Example: 123-4567
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user