materwelon
materwelon
DIAdiscord.js - Imagine an app
Created by materwelon on 5/15/2025 in #djs-questions
Inconsistent "Unknown Interaction" Error
None that I know of. But again, I'm not too familiar with proxies, so if I am, I wouldn't know that I am. I'm using Railway to host my bot. Does that help?
54 replies
DIAdiscord.js - Imagine an app
Created by materwelon on 5/15/2025 in #djs-questions
Inconsistent "Unknown Interaction" Error
why are both 524ms
54 replies
DIAdiscord.js - Imagine an app
Created by materwelon on 5/15/2025 in #djs-questions
Inconsistent "Unknown Interaction" Error
it happens randomly
54 replies
DIAdiscord.js - Imagine an app
Created by materwelon on 5/15/2025 in #djs-questions
Inconsistent "Unknown Interaction" Error
but how do I fix this
54 replies
DIAdiscord.js - Imagine an app
Created by materwelon on 5/15/2025 in #djs-questions
Inconsistent "Unknown Interaction" Error
yeah
54 replies
DIAdiscord.js - Imagine an app
Created by materwelon on 5/15/2025 in #djs-questions
Inconsistent "Unknown Interaction" Error
No description
54 replies
DIAdiscord.js - Imagine an app
Created by materwelon on 5/15/2025 in #djs-questions
Inconsistent "Unknown Interaction" Error
No description
54 replies
DIAdiscord.js - Imagine an app
Created by materwelon on 5/15/2025 in #djs-questions
Inconsistent "Unknown Interaction" Error
I don't know how or why but i haven't seen a single Unknown Interaction error since I added timestamps in the embed. :roouhh:
54 replies
DIAdiscord.js - Imagine an app
Created by materwelon on 5/15/2025 in #djs-questions
Inconsistent "Unknown Interaction" Error
Note that that 5s 253ms tells me that the processing of the interaction took 253ms. The 5s is the timeout i set for testing.
54 replies
DIAdiscord.js - Imagine an app
Created by materwelon on 5/15/2025 in #djs-questions
Inconsistent "Unknown Interaction" Error
No description
54 replies
DIAdiscord.js - Imagine an app
Created by materwelon on 5/15/2025 in #djs-questions
Inconsistent "Unknown Interaction" Error
noice thanks
54 replies
DIAdiscord.js - Imagine an app
Created by materwelon on 5/15/2025 in #djs-questions
Inconsistent "Unknown Interaction" Error
dyu have an example url for an interaction pls? If not, i'll throw an error and get it. Would be faster if you already have an example though :Pray:
54 replies
DIAdiscord.js - Imagine an app
Created by materwelon on 5/15/2025 in #djs-questions
Inconsistent "Unknown Interaction" Error
great! okay lemmi do that
54 replies
DIAdiscord.js - Imagine an app
Created by materwelon on 5/15/2025 in #djs-questions
Inconsistent "Unknown Interaction" Error
import { WebhookClient } from 'discord.js';
import { RegisterHook } from '../../decorators/RegisterHook';
import { HookedEvents, Hooks } from '../../interfaces/Hooks';
import { WebhookLog } from '../../interfaces/abstracts/WebhookLog';
import { BuilderComponent } from '../../../../bot/interfaces/Components';
import { Images } from '../../../library/globals/Assets';

@RegisterHook(Hooks.UnknownException)
export class UnknownException extends WebhookLog<Hooks.UnknownException> {
webhook = new WebhookClient({
url: ''
});

async execute() {
await this.webhook.send({
username: 'Unknown Exception',
avatarURL: Images.Error,
embeds: [new UnhandledErrorEmbed(this.data).component]
});
}
}

class UnhandledErrorEmbed extends BuilderComponent<'embed'> {
constructor(data: HookedEvents[Hooks.UnknownException]) {
super('embed');

const [uuid, error, guild, user] = data;

this.instance
.setTitle(`An unknown exception was thrown`)
.setColor('#ef4860')
.setDescription(
`**Guild ID:** \`${guild.id}\`\n` +
`**Guild Name:** ${guild.name}\n` +
`**User ID:** \`${user.id}\`\n` +
`**Username:** ${user.username}\n` +
`### UUID: \`${uuid}\`\n` +
'\`\`\`' +
error.stack +
'\`\`\`'
);
}
}
import { WebhookClient } from 'discord.js';
import { RegisterHook } from '../../decorators/RegisterHook';
import { HookedEvents, Hooks } from '../../interfaces/Hooks';
import { WebhookLog } from '../../interfaces/abstracts/WebhookLog';
import { BuilderComponent } from '../../../../bot/interfaces/Components';
import { Images } from '../../../library/globals/Assets';

@RegisterHook(Hooks.UnknownException)
export class UnknownException extends WebhookLog<Hooks.UnknownException> {
webhook = new WebhookClient({
url: ''
});

async execute() {
await this.webhook.send({
username: 'Unknown Exception',
avatarURL: Images.Error,
embeds: [new UnhandledErrorEmbed(this.data).component]
});
}
}

class UnhandledErrorEmbed extends BuilderComponent<'embed'> {
constructor(data: HookedEvents[Hooks.UnknownException]) {
super('embed');

const [uuid, error, guild, user] = data;

this.instance
.setTitle(`An unknown exception was thrown`)
.setColor('#ef4860')
.setDescription(
`**Guild ID:** \`${guild.id}\`\n` +
`**Guild Name:** ${guild.name}\n` +
`**User ID:** \`${user.id}\`\n` +
`**Username:** ${user.username}\n` +
`### UUID: \`${uuid}\`\n` +
'\`\`\`' +
error.stack +
'\`\`\`'
);
}
}
54 replies
DIAdiscord.js - Imagine an app
Created by materwelon on 5/15/2025 in #djs-questions
Inconsistent "Unknown Interaction" Error
where dyu see the URL in the error btw? I was trying to figure out a way to do this because I'm not passing the interaction object in my webhook error logger atm
54 replies
DIAdiscord.js - Imagine an app
Created by materwelon on 5/15/2025 in #djs-questions
Inconsistent "Unknown Interaction" Error
also will prevent flooding logs because i'll only get them when an error occurs
54 replies
DIAdiscord.js - Imagine an app
Created by materwelon on 5/15/2025 in #djs-questions
Inconsistent "Unknown Interaction" Error
that's actually a great idea.
54 replies
DIAdiscord.js - Imagine an app
Created by materwelon on 5/15/2025 in #djs-questions
Inconsistent "Unknown Interaction" Error
hmmm. Okay. Will try this out.
54 replies
DIAdiscord.js - Imagine an app
Created by materwelon on 5/15/2025 in #djs-questions
Inconsistent "Unknown Interaction" Error
there is no awaited processing before it gets to the handler. That should not be a problem though
54 replies
DIAdiscord.js - Imagine an app
Created by materwelon on 5/15/2025 in #djs-questions
Inconsistent "Unknown Interaction" Error
but don't know how long it takes to get to the handler.
54 replies