mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-11-14 21:26:08 +01:00
feat: used dahses for command readibility
This commit is contained in:
1 parent
23dd088466
commit
91f364b76a
13 files changed
+37
-49
No files matched your search
@@ -1,16 +1,7 @@
|
||||
import { Region } from '../../constants/regions';
|
||||
import { Period } from '../discord/addPeriodSubCommands';
|
||||
import { PeriodOption } from '../discord/addPeriodSubCommands';
|
||||
import getTimeDaysAgo from './getTimeDaysAgo';
|
||||
|
||||
export default function getPeriodStart(
|
||||
server: Region,
|
||||
period: Exclude<Period, 'customperiod'>,
|
||||
) {
|
||||
if (period === 'career') {
|
||||
return -Infinity;
|
||||
} else if (period === 'today') {
|
||||
return getTimeDaysAgo(server, 1);
|
||||
} else {
|
||||
return getTimeDaysAgo(server, parseInt(period.match(/\d+/)?.[0]!));
|
||||
}
|
||||
export default function getPeriodStart(region: Region, period: PeriodOption) {
|
||||
return period === 'career' ? 0 : getTimeDaysAgo(region, parseInt(period));
|
||||
}
|
||||
Reference in new issue
Block a user