make result auto pluralize
This commit is contained in:
parent
6b198ecb47
commit
bba4217bd7
|
@ -211,6 +211,9 @@ export const parseRoll = (fullCmd: string, modifiers: RollModifiers): SolvedRoll
|
||||||
let line2 = '';
|
let line2 = '';
|
||||||
let line3 = '';
|
let line3 = '';
|
||||||
|
|
||||||
|
// The ': ' is used by generateRollEmbed to split line 2 up
|
||||||
|
const resultStr = tempReturnData.length > 1 ? 'Results: ' : 'Result: ';
|
||||||
|
|
||||||
// If a theoretical roll is requested, mark the output as such, else use default formatting
|
// If a theoretical roll is requested, mark the output as such, else use default formatting
|
||||||
if (modifiers.maxRoll || modifiers.minRoll || modifiers.nominalRoll) {
|
if (modifiers.maxRoll || modifiers.minRoll || modifiers.nominalRoll) {
|
||||||
const theoreticalTexts = ['Maximum', 'Minimum', 'Nominal'];
|
const theoreticalTexts = ['Maximum', 'Minimum', 'Nominal'];
|
||||||
|
@ -218,18 +221,18 @@ export const parseRoll = (fullCmd: string, modifiers: RollModifiers): SolvedRoll
|
||||||
const theoreticalText = theoreticalTexts[theoreticalBools.indexOf(true)];
|
const theoreticalText = theoreticalTexts[theoreticalBools.indexOf(true)];
|
||||||
|
|
||||||
line1 = ` requested the Theoretical ${theoreticalText} of:\n\`${config.prefix}${fullCmd}\``;
|
line1 = ` requested the Theoretical ${theoreticalText} of:\n\`${config.prefix}${fullCmd}\``;
|
||||||
line2 = `Theoretical ${theoreticalText} Results: `;
|
line2 = `Theoretical ${theoreticalText} ${resultStr}`;
|
||||||
} else if (modifiers.order === 'a') {
|
} else if (modifiers.order === 'a') {
|
||||||
line1 = ` requested the following rolls to be ordered from least to greatest:\n\`${config.prefix}${fullCmd}\``;
|
line1 = ` requested the following rolls to be ordered from least to greatest:\n\`${config.prefix}${fullCmd}\``;
|
||||||
line2 = 'Results: ';
|
line2 = resultStr;
|
||||||
tempReturnData.sort(compareTotalRolls);
|
tempReturnData.sort(compareTotalRolls);
|
||||||
} else if (modifiers.order === 'd') {
|
} else if (modifiers.order === 'd') {
|
||||||
line1 = ` requested the following rolls to be ordered from greatest to least:\n\`${config.prefix}${fullCmd}\``;
|
line1 = ` requested the following rolls to be ordered from greatest to least:\n\`${config.prefix}${fullCmd}\``;
|
||||||
line2 = 'Results: ';
|
line2 = resultStr;
|
||||||
tempReturnData.sort(compareTotalRollsReverse);
|
tempReturnData.sort(compareTotalRollsReverse);
|
||||||
} else {
|
} else {
|
||||||
line1 = ` rolled:\n\`${config.prefix}${fullCmd}\``;
|
line1 = ` rolled:\n\`${config.prefix}${fullCmd}\``;
|
||||||
line2 = 'Results: ';
|
line2 = resultStr;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fill out all of the details and results now
|
// Fill out all of the details and results now
|
||||||
|
|
Loading…
Reference in New Issue