3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-14 21:31:50 +00:00

feat: Make tag list search case-insensitive

This commit is contained in:
Jonah Lawrence 2023-05-16 06:52:24 -06:00 committed by GitHub
parent 5f194bf1ef
commit da59435ae9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -20,7 +20,7 @@ export const TagListCmd = tagsCmd({
const prefix = (await pluginData.config.getForMessage(msg)).prefix;
const tagNames = tags.map((tag) => tag.tag).sort();
const searchRegex = args.search ? new RegExp([...args.search].map((s) => escapeStringRegexp(s)).join(".*")) : null;
const searchRegex = args.search ? new RegExp([...args.search].map((s) => escapeStringRegexp(s)).join(".*"), "i") : null;
const filteredTags = args.search ? tagNames.filter((tag) => searchRegex!.test(tag)) : tagNames;