Merge pull request #101 from neilmiddleton/nm-issue-83

Make `!mjolnir` not case sensitive
This commit is contained in:
Travis Ralston 2021-06-14 08:37:19 -06:00 committed by GitHub
commit 150be16cb1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -84,7 +84,7 @@ export class Mjolnir {
];
if (config.commands.allowNoPrefix) prefixes.push("!");
const prefixUsed = prefixes.find(p => content['body'].startsWith(p));
const prefixUsed = prefixes.find(p => content['body'].toLowerCase().startsWith(p.toLowerCase()));
if (!prefixUsed) return;
// rewrite the event body to make the prefix uniform (in case the bot has spaces in its display name)