mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-03 06:28:51 +00:00
WIP
This commit is contained in:
1 parent
949ea4ba4b
commit
e01fa0ab0a
16 files changed
+406
-231
No files matched your search
@@ -0,0 +1,13 @@
|
||||
import { config } from '../server';
|
||||
|
||||
export function getRandomPhoneNumber() {
|
||||
if (!config.general.useDashNumber) {
|
||||
return Math.floor(Math.random() * 10000000).toString(); // 10000000 creates a number with 7 characters.
|
||||
}
|
||||
|
||||
return Math.floor(Math.random() * 10000000)
|
||||
.toString()
|
||||
.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