Skip to content

Commit

Permalink
fix: case insensitive bot commands (#478)
Browse files Browse the repository at this point in the history
  • Loading branch information
shaunnope committed Aug 21, 2023
1 parent 35b96c0 commit ed71c1f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,9 @@ const checker: StaticHas = {
const index = cmd.indexOf("@");
if (index === -1) return false;
const atTarget = cmd.substring(index + 1);
if (atTarget !== ctx.me.username) return false;
if (atTarget.toLowerCase() !== ctx.me.username.toLowerCase()) {
return false;
}
const atCommand = cmd.substring(0, index);
if (noAtCommands.has(atCommand)) {
ctx.match = txt.substring(cmd.length + 1).trimStart();
Expand Down

0 comments on commit ed71c1f

Please sign in to comment.