From 531fd1379cd4243e76ddadee6770572b6bfccaa2 Mon Sep 17 00:00:00 2001 From: Neil Middleton Date: Mon, 14 Jun 2021 14:43:50 +0100 Subject: [PATCH] Make `!mjolnir` not case sensitive --- src/Mjolnir.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Mjolnir.ts b/src/Mjolnir.ts index fd577b5c..bc82ecba 100644 --- a/src/Mjolnir.ts +++ b/src/Mjolnir.ts @@ -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)