From 531fd1379cd4243e76ddadee6770572b6bfccaa2 Mon Sep 17 00:00:00 2001 From: Neil Middleton Date: Mon, 14 Jun 2021 14:43:50 +0100 Subject: [PATCH 1/2] 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 fd577b5..bc82ecb 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) From 1c5c4bdc1522118eb3f776e8bf66cf4a87b673f6 Mon Sep 17 00:00:00 2001 From: Neil Middleton Date: Mon, 14 Jun 2021 14:51:18 +0100 Subject: [PATCH 2/2] Remove errant log --- src/Mjolnir.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Mjolnir.ts b/src/Mjolnir.ts index bc82ecb..71ea53d 100644 --- a/src/Mjolnir.ts +++ b/src/Mjolnir.ts @@ -84,8 +84,6 @@ export class Mjolnir { ]; if (config.commands.allowNoPrefix) prefixes.push("!"); - console.log(content['body']) - const prefixUsed = prefixes.find(p => content['body'].toLowerCase().startsWith(p.toLowerCase())); if (!prefixUsed) return;