feat: migrated to new db

This commit is contained in:
TrèsAbhi committed 2024-04-03 15:19:48 -05:00
1 parent 0885e7e68a
commit 4062e56b4c
19 files changed
+79 -60

No files matched your search

+19
View File
@@ -0,0 +1,19 @@
import { Region } from '../../constants/regions';
export function idToRange(id: number): Region {
if (id >= 42e8) {
throw new Error('bot id');
} else if (id >= 31e8) {
throw new Error('china id');
} else if (id >= 20e8) {
return 'asia';
} else if (id >= 10e8) {
return 'com';
} else if (id >= 5e8) {
return 'eu';
} else if (id >= 0) {
throw new Error('ru id');
} else {
throw new Error(`id ${id} is out of range`);
}
}