IncendiumSkye
DIAdiscord.js - Imagine an app
•Created by IncendiumSkye on 7/19/2024 in #djs-questions
Handling commands with promises
Hi! So I have been working on this problem for a bit now. I've slowly solved most of the issues I've run into, but this one has me stumped. I know how to handle promises normally, but I cant seem to be able to make it work when loading commands.
Here is a little explanation of the command im making. Basically, In my server we have a command to create characters. That command seems to be working find, but then I made a command that retrieves that character info. In order to avoid having any spelling issues or dealing with case insensitivity What I did was loaded all of the characters in the db using prismaORM and mapped the names so they can be passed into the setChoices method in the EmbedBuilder class. However because this requires async/await it isn't quite working right. Below is my code and a screenshot of the error I'm getting. Thank you in advance for the help on this!
There actually isnt an error, but my condition in index.js is saying "Command with name [] not found. Even though the deploy-commands.js is loading 4 commands (and thats all i have so far.)
101 replies