Skip to content

Commit

Permalink
feat: fallback message for old commands (#1017)
Browse files Browse the repository at this point in the history
* feat: fallback message for old commands

* chore: formatting
  • Loading branch information
geisterfurz007 authored Jul 14, 2023
1 parent 4efc822 commit d183da8
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/events/message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,19 @@ const commandMap: Record<string, string> = {
"@group": "group ping",
};

const oldContextMenuCommands: string[] = ["!meta", "!addvote"];

export const legacyCommandHandler = async (message: Message) => {
const firstWord = message.content.split(" ")[0];
const firstWord = message.content.split(" ")[0].toLowerCase();

if (oldContextMenuCommands.includes(firstWord)) {
await Tools.handleUserError(
message,
"Hey there, it seems you have used one of the commands that have been converted to context menu commands. You can select the message now and go to Apps to make use of the command instead"
);
return;
}

const newCommand = commandMap[firstWord];

if (!newCommand) return;
Expand Down

0 comments on commit d183da8

Please sign in to comment.