Skip to content

Commit

Permalink
If channel fetch fails, log to console
Browse files Browse the repository at this point in the history
  • Loading branch information
Glazelf committed Jan 8, 2025
1 parent 3e464b0 commit e1383d8
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions events/debug.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,13 @@ export default async (client, info) => {
if (info.length > maxDescriptionLength) description = info.substring(0, maxDescriptionLength);
let debugInfoIndex = maxDescriptionLength;
// Channel
let debugChannel = client.channels.cache.get(debugChannelID);
if (!debugChannel) debugChannel = await client.channels.fetch(debugChannelID);
let debugChannel;
try {
debugChannel = await client.channels.fetch(debugChannelID);
} catch (e) {
// console.log(e);
return console.log(info);
};
// Build embed
let debugEmbed = new EmbedBuilder()
.setColor(globalVars.embedColor)
Expand Down

0 comments on commit e1383d8

Please sign in to comment.