mirror of
https://github.com/toast-ts/Daggerbot-TS.git
synced 2024-11-17 04:10:59 -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 filter = DSS?.vehicles.filter(x=>CATEGORY_FILTER.includes(x.category));
|
||||||
const rules = {
|
const rules = {
|
||||||
one: 'single pallet',
|
one: 'single pallet',
|
||||||
two: 'pallets',
|
|
||||||
few: 'pallets',
|
|
||||||
other: 'pallets'
|
other: 'pallets'
|
||||||
}[new Intl.PluralRules('en', {type: 'ordinal'}).select(filter.length)];
|
}[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 {
|
else {
|
||||||
const getLongestName = Object.entries(this.getPalletCounts(DSS)).map(([name, _])=>name.length).sort((a,b)=>b-a)[0];
|
const getLongestName = Object.entries(this.getPalletCounts(DSS)).map(([name, _])=>name.length).sort((a,b)=>b-a)[0];
|
||||||
await interaction.editReply(MessageTool.concatMessage(
|
await interaction.editReply(MessageTool.concatMessage(
|
||||||
|
Loading…
Reference in New Issue
Block a user