mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 11:39:50 +02:00
feat: migrated to new db
This commit is contained in:
1 parent
0885e7e68a
commit
4062e56b4c
19 files changed
+79
-60
No files matched your search
@@ -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`);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user