mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-02 22:17:39 +00:00
14 lines
467 B
TypeScript
14 lines
467 B
TypeScript
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
|
|
}
|