Add /getcharlore and /getpersonalore commands

Closes #3183
This commit is contained in:
Cohee
2024-12-14 18:48:14 +02:00
parent e960ae64c5
commit 713c05f808
2 changed files with 73 additions and 4 deletions

View File

@ -2112,7 +2112,7 @@ export async function showFontAwesomePicker(customList = null) {
* @param {string[]?} [options.filteredByTags=null] - Tags to filter characters by
* @param {boolean} [options.preferCurrentChar=true] - Whether to prefer the current character(s)
* @param {boolean} [options.quiet=false] - Whether to suppress warnings
* @returns {any?} - The found character or null if not found
* @returns {import('./char-data.js').v1CharData?} - The found character or null if not found
*/
export function findChar({ name = null, allowAvatar = true, insensitive = true, filteredByTags = null, preferCurrentChar = true, quiet = false } = {}) {
const matches = (char) => !name || (allowAvatar && char.avatar === name) || (insensitive ? equalsIgnoreCaseAndAccents(char.name, name) : char.name === name);