This commit is contained in:
2026-05-13 10:18:54 +03:00
parent cd8d2683c0
commit c5b61ee3d8
38 changed files with 3929 additions and 3718 deletions
+8 -6
View File
@@ -21,8 +21,9 @@ export class Ae extends Command {
try {
let result = this.executeEvaluation(match);
await oldSendMessage(msg, result).catch(async () => await errorPlaceholder(msg));
} catch (e: any) {
const text = e.message.toString();
} catch (e: unknown) {
const error = e instanceof Error ? e : new Error(String(e));
const text = error.message.toString();
if (text.includes("is not defined")) {
await oldSendMessage(msg, Environment.variableNotDefinedText).catch(logError);
@@ -30,7 +31,7 @@ export class Ae extends Command {
}
logError(`${text}
* Stacktrace: ${e.stack}`);
* Stacktrace: ${error.stack}`);
await oldSendMessage(msg, text).catch(logError);
}
@@ -43,15 +44,16 @@ export class Ae extends Command {
e = ((typeof e == "string") ? e : JSON.stringify(e));
return e;
} catch (e: any) {
const text = e.message.toString();
} catch (e: unknown) {
const error = e instanceof Error ? e : new Error(String(e));
const text = error.message.toString();
if (text.includes("is not defined")) {
return Environment.evaluationVariableNotDefinedText;
}
logError(`${text}
* Stacktrace: ${e.stack}`);
* Stacktrace: ${error.stack}`);
return text;
}