sraech
sraech
DIAdiscord.js - Imagine an app
Created by sraech on 10/30/2024 in #djs-questions
Roles Cache sometimes inconsistent
I got very simple code
const role = channel.guild.roles.cache.get(pingRoleId);
size = role?.members?.size
const role = channel.guild.roles.cache.get(pingRoleId);
size = role?.members?.size
And the size is sometimes different, and after restart of the application the cache is correct again and shows the correct size Is there a way to manually refresh the cache or to prevent this issue?
6 replies
DIAdiscord.js - Imagine an app
Created by sraech on 5/13/2024 in #djs-questions
Trying to get a list of members of a role
:peepoThink: I'm getting the message of a user (me) and then im trying this and the roleInfo is undefined
const roleId = 1239663214099169372;
const strRoleId = '1239663214099169372';
const roleInfo = message.guild.roles.cache.get(roleId);
const roleId = 1239663214099169372;
const strRoleId = '1239663214099169372';
const roleInfo = message.guild.roles.cache.get(roleId);
35 replies
DIAdiscord.js - Imagine an app
Created by sraech on 4/26/2024 in #djs-questions
Repeating interaction
Is there a way to use the 'interaction.update' multiple times? So i can make like one button after another :peepoThink: Struggling to do so.
27 replies