Skip to content

Commit

Permalink
Only check first line for command trigger, don't mention replied user (
Browse files Browse the repository at this point in the history
  • Loading branch information
vcarl authored Aug 13, 2024
1 parent 544fcad commit 3807912
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/features/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1147,7 +1147,6 @@ _ _
category: "Web",
handleMessage: (msg) => {
const firstMention = msg.mentions.users.first();

const embed = {
title: "",
type: EmbedType.Rich,
Expand Down Expand Up @@ -1188,7 +1187,7 @@ Authentication is a critical part of most web applications. Here are some resour
color: EMBED_COLOR,
};

if (firstMention) {
if (firstMention && firstMention.id !== msg.mentions.repliedUser?.id) {
embed.description = `Hey ${firstMention}, ${embed.description}`;
}

Expand Down Expand Up @@ -1219,7 +1218,8 @@ const createCommandsMessage = () => {
// Mutating in map(), but whatever
commands.sort((a, b) => {
// Assume there's at least one trigger word per command
return a.words[0].localeCompare(b.words[0]);
// Only check the first line of the message
return a.words[0].split("\n", 1)[0].localeCompare(b.words[0]);
});

const boldTitle = `**${category}**`;
Expand Down

0 comments on commit 3807912

Please sign in to comment.