mirror of
https://github.com/toast-ts/Daggerbot-TS.git
synced 2024-11-17 00:10:58 -05:00
Fix race condition for rules
This commit is contained in:
parent
b9d15b0982
commit
e901cc84d8
@ -149,11 +149,9 @@ export default class MP {
|
||||
const filter = DSS?.vehicles.filter(x=>CATEGORY_FILTER.includes(x.category));
|
||||
const rules = {
|
||||
one: 'single pallet',
|
||||
two: 'pallets',
|
||||
few: 'pallets',
|
||||
other: 'pallets'
|
||||
}[new Intl.PluralRules('en', {type: 'ordinal'}).select(filter.length)];
|
||||
if (filter.length < 1) return interaction.editReply('No pallets found on the server.');
|
||||
if (filter.length === 0) return interaction.editReply('No pallets found on the server.');
|
||||
else {
|
||||
const getLongestName = Object.entries(this.getPalletCounts(DSS)).map(([name, _])=>name.length).sort((a,b)=>b-a)[0];
|
||||
await interaction.editReply(MessageTool.concatMessage(
|
||||
|
Loading…
Reference in New Issue
Block a user