From 7301df4d9d73b235ae4872432ccaea24cd2a3aa1 Mon Sep 17 00:00:00 2001 From: Ean Milligan Date: Sun, 13 Jul 2025 04:42:47 -0400 Subject: [PATCH] fix alias system --- src/commands/aliasCmd/aliasAddUpdate.ts | 5 +++-- src/commands/aliasCmd/run.ts | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/commands/aliasCmd/aliasAddUpdate.ts b/src/commands/aliasCmd/aliasAddUpdate.ts index 26b0b70..02a0022 100644 --- a/src/commands/aliasCmd/aliasAddUpdate.ts +++ b/src/commands/aliasCmd/aliasAddUpdate.ts @@ -192,7 +192,7 @@ If you are trying to update an existing alias, but forgot the name, please run t .slice(openIdx + 1, closeIdx) .join('') .split(/(y\d+(\.\d*)?)/g) - .filter((y) => y.startsWith('y')); + .filter((y) => y && y.startsWith('y')); for (const yVar of possibleYVars) { if (yVar.includes('.')) { newMsg @@ -224,6 +224,7 @@ If you are trying to update an existing alias, but forgot the name, please run t openIdx = testCmdConf.indexOf(config.prefix, closeIdx); } } catch (e) { + const err = e as Error; newMsg .edit({ embeds: [ @@ -238,7 +239,7 @@ If you are trying to update an existing alias, but forgot the name, please run t }, { name: 'Raw Error:', - value: `\`${JSON.stringify(e)}\``, + value: `${err.name}: ${err.message}`, }, ], footer: { diff --git a/src/commands/aliasCmd/run.ts b/src/commands/aliasCmd/run.ts index d085893..17500d3 100644 --- a/src/commands/aliasCmd/run.ts +++ b/src/commands/aliasCmd/run.ts @@ -63,7 +63,7 @@ export const run = async (message: DiscordenoMessage, guildMode: boolean, comman } const details = query.shift(); - if (!query.length || !details) { + if (!details) { message .send({ embeds: [