This commit is contained in:
Dragon Fire
2021-02-20 11:29:53 -05:00
parent 841e17cc01
commit 1202e2c4e6
+4 -4
View File
@@ -23,14 +23,14 @@ module.exports = class FontArgumentType extends ArgumentType {
}); });
if (foundExact.size === 1) return true; if (foundExact.size === 1) return true;
if (foundExact.size > 0) found = foundExact; if (foundExact.size > 0) found = foundExact;
return found.size <= 15 ? return found.size <= 15
`${disambiguation(found.map(font => escapeMarkdown(font.name)), 'fonts', null)}\n` : ? `${disambiguation(found.map(font => escapeMarkdown(font.name)), 'fonts', null)}\n`
'Multiple fonts found. Please be more specific.'; : 'Multiple fonts found. Please be more specific.';
} }
parse(value) { parse(value) {
const choice = value.toLowerCase(); const choice = value.toLowerCase();
let found = this.client.fonts.filter(font => { const found = this.client.fonts.filter(font => {
if (font.isVariant) return false; if (font.isVariant) return false;
if (font.name.toLowerCase().includes(choice)) return true; if (font.name.toLowerCase().includes(choice)) return true;
if (font.filenameNoExt.toLowerCase().includes(choice)) return true; if (font.filenameNoExt.toLowerCase().includes(choice)) return true;