userse

Hello, what is the correct event I need to use in order to monitor a permission that changed on specific channel, for example if a "everyone" role ViewChannel/Connect permission has been changed to 'x'
19 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.
treble/luna
treble/luna2y ago
i assume it would be in a channelUpdate event, but i'm not sure, if not you can try via audit logs
Shahar
ShaharOP2y ago
Currently I am using channelUpdate, but it has so High Frequency, there is so many triggers for that event that I cant just return them
treble/luna
treble/luna2y ago
just filter them out
Shahar
ShaharOP2y ago
The only thing i could think about is that i check the type and I only react if its a voice channel, is there more check i could do? Because I still see in console alot of request coming And the paramters it give not contains propeties that I use
treble/luna
treble/luna2y ago
just filter on whether the permissionOverwrites have changed or not
Shahar
ShaharOP2y ago
somtimes its not giving a parameter of permissionOverwrites and when I try to access the propety the bot crash unless i do try catch
treble/luna
treble/luna2y ago
show your code
Shahar
ShaharOP2y ago
Shahar
ShaharOP2y ago
^
treble/luna
treble/luna2y ago
you dont have to ping me for every message you send
Shahar
ShaharOP2y ago
I am sorry, my bad, habbit
treble/luna
treble/luna2y ago
and is it your oldCHannel that sometimes has no or little properties?
Shahar
ShaharOP2y ago
I dont exeactly know the reason yet, still trying to understand whats going on, but the bot is currently running and somtimes I will get like 20 console.error and I dont know what triggers it But it all points to that event
treble/luna
treble/luna2y ago
do you happen to have Partials enabled in your client?
Shahar
ShaharOP2y ago
treble/luna
treble/luna2y ago
can you show the errors you get
Shahar
ShaharOP2y ago
I will have to wait until the bot crash again, unfortunately I didnt save the error, just reboot the bot and the error gone
treble/luna
treble/luna2y ago
i'm suspecting your 'oldChannel' might be a partial on some occasions would explain why not all properties are present if any
Want results from more Discord servers?
Add your server