Skip to content

Commit 12e851c

Browse files
Merge pull request #63 from Chiissu/dev
uh oh
2 parents 73b03e8 + a6630b5 commit 12e851c

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

src/events/interactionCreate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export default (async function run(interaction) {
2323

2424
if (!command) return;
2525
if (interaction.isChatInputCommand()) {
26-
await noErrorsPlease(interaction);
26+
await noErrorsPlease(interaction, command.data.name);
2727
command.run(interaction);
2828
}
2929
if (command.autocomplete) command.autocomplete(interaction);

src/utils/embeds/errorEmbed.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,10 @@ export async function errorEmbed(options: {
5757

5858
if (options.error) {
5959
embed.addFields(
60-
{ name: "💬 • Error message", value: `${codeBlock(error.message)} in \`${fileName}\`` },
60+
{
61+
name: "💬 • Error message",
62+
value: `${codeBlock(error.message)}${fileName ? `in \`${fileName}\`` : ""}`,
63+
},
6164
{
6265
name: "📜 • Error stack",
6366
value: stack

src/utils/noErrorsPlease.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { errorEmbed } from "embeds/errorEmbed";
33
import { errorType } from "./errorType";
44

55
const errorRateLimit = new Set<string>();
6-
export async function noErrorsPlease(interaction: ChatInputCommandInteraction) {
6+
export async function noErrorsPlease(interaction: ChatInputCommandInteraction, fileName: string) {
77
process.removeAllListeners();
88
const sendErrorMessage = async (
99
error: Error,
@@ -15,7 +15,7 @@ export async function noErrorsPlease(interaction: ChatInputCommandInteraction) {
1515

1616
errorRateLimit.add(errorKey);
1717
setTimeout(() => errorRateLimit.delete(errorKey), 10000);
18-
await errorEmbed({ interaction, error, log: true, forward: true });
18+
await errorEmbed({ interaction, error, log: true, forward: true, fileName });
1919
};
2020

2121
const processEventListeners: { [key: string]: { listener: (...args: any[]) => Promise<void> } } =

0 commit comments

Comments
 (0)