Sky
Sky
DIAdiscord.js - Imagine an app
Created by Sky on 5/28/2024 in #djs-questions
V10, roles cache pulling only "undefined" roles until the code is ran again
yes I know I need to update, I am not learning multiple versions worth of things in a single day, I just need to tweak my bot from last year to do a small additional thing for in a couple days time. I had this issue when I was originally making this bot, but I don't remember what fixed it, and I sure as hell haven't changed anything that could have been for it. Essentially this bot checks for a password via a DM, then gives a role to that user/checks if they have the role already. The issue is that the bot is throwing "TypeError: Cannot read properties of undefined (reading 'roles')" on the first input of the password, but on the second it runs fine. Code attached Line 69 has the issue, the first if statement part just checking if the user has the first role
34 replies