User object roles

If a user uses a slash command, is there a guarantee the member object I receive in the handler would be the latest update of that member? I had assumed that would be the case but I'm having behaviour that would suggest the member object I receive does not have the latest up to date information on what roles the user has.
Solution:
Turned out to be user error lol
Kevin
Kevin96d ago
member.fetch(true) will re-fetch the member from the discord api and bypass the cache
kyra
kyra95d ago
Yes, Discord sends up-to-date data, and Discord.js handles it using users._add and members._add, which cache by default.
Ravelt
Ravelt95d ago
And would this happen before a precondition is processed by sapphire? Specifically the problem I'm having is that I have a precondition that checks if a role id is in the roles.cache of the member object passed in the precondition handler. People are reporting that it's been randomly working and randomly not working which leads me to believe that something is not up to date
kyra
kyra95d ago
Before the event is even emitted on Discord.js's side, way before Sapphire can even handle it.
Ravelt
Ravelt95d ago
I see I will have to do some deeper investigating Thanks for answering btw
Solution
Ravelt
Ravelt95d ago
Turned out to be user error lol
Want results from more Discord servers?
Add your server
More Posts
Select Menu Listener Fails To RegisterHello, I'm trying to implement a Select Menu Listener and get an error that a compatible class expoArgument examplesAre there any examples for duration arguments available? I'm struggling with duration arguments for Message commands not workingWhen I run, nothing happens. No errors, no bot response. Here's the code: https://github.com/BolasidIssue with @sapphire/plugin-apiHello, I have installed @sapphire/plugin-api using the following command: ``` npm i @sapphire/plugiPrecondition CommandIn a global precondition, is it possible to get the command object for the command the precondition Is documentation page outdated?I'm a first-time sapphire user, but I couldn't find an answer to my question. The documentation sayPrecondition i18nPer this example here https://www.sapphirejs.dev/docs/Guide/preconditions/global-preconditions is itGot this error when executing command /kickI never got this error before, i edited my /kick command and after doing so i executed the command tHow to add string optionsi need help with how to add string options if i add then them the normal way ie: .addStringOption((oError when using @sapphire/type``` Error: Cannot find module '/workspaces/shim/node_modules/@sapphire/type/prebuild/type-node-v115-Commands + Listeners not registeringMy commands and listeners are not registering/running. I suspect its because I'm using tsx but am noDelete Message Instantlyhttps://github.com/skyra-project/skyra/blob/main/src/lib/util/functions/messages.ts does the `deletListener run() signatureFeel like I'm missing something obvious.. how do I find out the correct signature for a `run` methodPaginatedMessageEmbedFields empty arraySo im kinda confused with the docs and im always getting empty array's when im trying to setItems ovGetting the deleter of a deleted messageHi, I'm trying to get the deleter of a deleted message using `.fetchAuditLogs()` and `.entries.firstIssue registering command on a specific guild using guildIdsHello, I am having some issues trying to register a slash command to a specific guild. I have this "Subfolders Inside Commands FolderCan i put the commands inside subfolders in commands folder ? example command path : commands/publMake a button executable only by the command executerHello, I want to make a button only executable only by the person who ran it. For example, if personEncountering Error `TypeError: emitter.getMaxListeners is not a function`Happens as soon as I run the code. I am using ts-node so I have no idea if this is the reason why.Problem loading virtual piecesIf I go by file system mode, all commands & listeners get loaded. But if I go by virtual piece route