Make !mjolnir not case sensitive

This commit is contained in:
Neil Middleton
2021-06-14 14:43:50 +01:00
parent 510e9b5fd2
commit 531fd1379c
+3 -1
View File
@@ -84,7 +84,9 @@ export class Mjolnir {
];
if (config.commands.allowNoPrefix) prefixes.push("!");
const prefixUsed = prefixes.find(p => content['body'].startsWith(p));
console.log(content['body'])
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)