Error Events

I have the channelUpdate event that has been executed when mee6 has updated the roles to a user and that should not be activated when it does that, what should I do? https://media.discordapp.net/attachments/1127276232543842384/1128353924726935699/image.png
14 Replies
d.js toolkit
d.js toolkit2y ago
- What's your exact discord.js npm list discord.js and node node -v version? - Post the full error stack trace, not just the top part! - Show your code! - Explain what exactly your issue is. - Not a discord.js issue? Check out #useful-servers.
grass
grass2y ago
- What's your exact discord.js npm list discord.js and node node -v version? - Post the full error stack trace, not just the top part! - Show your code! - Explain what exactly your issue is. - Not a discord.js issue? Check out #useful-servers.
JuanQ
JuanQOP2y ago
This is my code:
if (newChannel.type === 1 || newChannel.type === 3) return;
if (newChannel.position !== oldChannel.position) return;

const auditLogs = await oldChannel.guild.fetchAuditLogs({
type: Discord.GuildAuditLogs.ChannelUpdate,
});
if (newChannel.type === 1 || newChannel.type === 3) return;
if (newChannel.position !== oldChannel.position) return;

const auditLogs = await oldChannel.guild.fetchAuditLogs({
type: Discord.GuildAuditLogs.ChannelUpdate,
});
a?
grass
grass2y ago
what makes you think it is emitting
JuanQ
JuanQOP2y ago
What do you mean by "emitting" I don't understand English is not my main language
grass
grass2y ago
what makes you think that channelUpdate event is being run
JuanQ
JuanQOP2y ago
If you see in the image he has banned mee6 for the channelUpdate event since the reason that comes out is from that event and I don't have a guildMemberUpdate
grass
grass2y ago
show that code then, preferably in a bin
d.js docs
d.js docs2y ago
To share long code snippets use a service like gist, sourcebin, starbin, or similar instead of posting them as large code blocks.
JuanQ
JuanQOP2y ago
here you have the channelUpdate.js https://pastebin.com/8hwKgRGa
Pastebin
const channel_a_cache = new Map();const Discord = require('discord....
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
JuanQ
JuanQOP2y ago
and is there an alternative or something?
d.js docs
d.js docs2y ago
event (event) Client#guildAuditLogEntryCreate Emitted whenever a guild audit log entry is created.
JuanQ
JuanQOP2y ago
So should I put it like this?
const auditLogs = await oldRole.guild.fetchAuditLogs({ type: Discord.GuildAuditLogs.GuildRoleUpdate, limit: 1 });
const auditLogs = await oldRole.guild.fetchAuditLogs({ type: Discord.GuildAuditLogs.GuildRoleUpdate, limit: 1 });
Could you give me an example of how to use it? I don't know how to use that event 😅

Did you find this page helpful?