Tojikimado
DIAdiscord.js - Imagine an app
•Created by Tojikimado on 2/7/2024 in #djs-questions
Log channel's permissions update
Here’s my code: https://starb.in/KTwWnt.typescript
I still can’t manage when I update the perms of two channel'sroles, the channelUpdate event is fired twice and I got 2 logs but I only want one log with all the changes.
44 replies
DIAdiscord.js - Imagine an app
•Created by Tojikimado on 2/7/2024 in #djs-questions
Log channel's permissions update
I haven’t changed anything and it works fine when I change the perms of a role.
It still doesn’t work when I was editing multiple roles, but it’s normal because I still haven’t managed it
44 replies
DIAdiscord.js - Imagine an app
•Created by Tojikimado on 2/7/2024 in #djs-questions
Log channel's permissions update
I clean my code : https://starb.in/0C8Rmd.typescript
But now when i'm updating channel's perms, it doesn't work anymore.
For example if i edit only one perm of everyone role, i got this log :
Modification des permissions d'un salon
Les permissions du salon aaaaa ont été modifiées !
everyone
✅ | ViewChannel
Tojikimado
✅ | ViewChannel
A
✅ | ViewChannel
K
✅ | ViewChannel
Channel modifié par Tojikimado•Aujourd’hui à 16:26
If i edit one perm in 2 roles (everyone & K), i got this logs :
Modification des permissions d'un salon
Les permissions du salon aaaaa ont été modifiées !
K
❌ | ViewChannel
Tojikimado
❌ | ViewChannel
everyone
❌ | ViewChannel
❌ | ViewChannel
Channel modifié par Tojikimado•Aujourd’hui à 16:27
Modification des permissions d'un salon
Les permissions du salon aaaaa ont été modifiées !
K
❌ | ViewChannel
Tojikimado
❌ | ViewChannel
everyone
❌ | ViewChannel
Channel modifié par Tojikimado•Aujourd’hui à 16:27
Am I missing something ?
44 replies
DIAdiscord.js - Imagine an app
•Created by Tojikimado on 2/7/2024 in #djs-questions
Log channel's permissions update
Yeah it's not broken but i only want one log
44 replies
DIAdiscord.js - Imagine an app
•Created by Tojikimado on 2/7/2024 in #djs-questions
Log channel's permissions update
By "fix", i mean only have one log with all changes
44 replies
DIAdiscord.js - Imagine an app
•Created by Tojikimado on 2/7/2024 in #djs-questions
Log channel's permissions update
How can i "fix" this ?
44 replies
DIAdiscord.js - Imagine an app
•Created by Tojikimado on 2/7/2024 in #djs-questions
Log channel's permissions update
44 replies
DIAdiscord.js - Imagine an app
•Created by Tojikimado on 2/7/2024 in #djs-questions
Log channel's permissions update
I just added the default perm detection, and now when I change a allow perm to deny or deny to allow, it logs me this and I don’t understand why because it worked before:
✅ | ManageChannels
❌ | ManageChannels
44 replies
DIAdiscord.js - Imagine an app
•Created by Tojikimado on 2/7/2024 in #djs-questions
Log channel's permissions update
After multiple tries, i still can't catch when a perm switch to default
44 replies
DIAdiscord.js - Imagine an app
•Created by Tojikimado on 2/7/2024 in #djs-questions
Log channel's permissions update
I quickly checked what we discussed.
I don’t understand how to set the perm to and do this rolePermissions.default.push(“🔳 | ${permission}”)
Everything else is correct?
Here is my code :
44 replies
DIAdiscord.js - Imagine an app
•Created by Tojikimado on 2/7/2024 in #djs-questions
Log channel's permissions update
The state before is not really important.
I want to see if it's now default.
For the role name i can do this ? : const roleName = newChannel.guild.roles.cache.get(key) |.| (search member with id) || "@everyone";
I will test after when I’m back on my pc
44 replies
DIAdiscord.js - Imagine an app
•Created by Tojikimado on 2/7/2024 in #djs-questions
Log channel's permissions update
Oh yeah mb, i forget this basic thing
44 replies
DIAdiscord.js - Imagine an app
•Created by Tojikimado on 2/7/2024 in #djs-questions
Log channel's permissions update
Same for missingAllowInOld inside the loop of missingAllowInNew ?
With this system how can i know when perm = default ?
44 replies
DIAdiscord.js - Imagine an app
•Created by Tojikimado on 2/7/2024 in #djs-questions
Log channel's permissions update
And if it's a member how can i get him ? 🤔
44 replies
DIAdiscord.js - Imagine an app
•Created by Tojikimado on 2/7/2024 in #djs-questions
Log channel's permissions update
Thank you. Do you have any idea for when i switch to default ?
I didn’t have much time so I did this quickly without testing. I’ll see a little later
44 replies
DIAdiscord.js - Imagine an app
•Created by Tojikimado on 2/7/2024 in #djs-questions
Log channel's permissions update
@Qjuh It's not working at 100% for now
roleName is always = everyone
if perm is allowed or denied and i switch it to default, it's not working
44 replies
DIAdiscord.js - Imagine an app
•Created by Tojikimado on 2/7/2024 in #djs-questions
Log channel's permissions update
So now, i only have this :
Is that what you said ? But i don't see what i can do whith this
44 replies
DIAdiscord.js - Imagine an app
•Created by Tojikimado on 2/7/2024 in #djs-questions
Log channel's permissions update
I don't really see how can i only loop over all changed permissions before updating log description with the state of the permission (allow, deny or default)
44 replies
DIAdiscord.js - Imagine an app
•Created by Tojikimado on 2/7/2024 in #djs-questions
Log channel's permissions update
Hmm I’ll check how to do this, I hope it won’t take me long
44 replies
DIAdiscord.js - Imagine an app
•Created by Tojikimado on 2/7/2024 in #djs-questions
Log channel's permissions update
I'm a bit confused here 😅
If i look at my last version of the code.
I have to only have one for each on the roles that have overwrites and remove this one newPermissionsOverwrites.cache.forEach((newPermissions, key) => { ?
And remove the 6 forEach and use something like this const newPermissions = newPermissionsOverwrites.cache.get(role.id) ?
44 replies