Command is always undefined even if i know for a fact that command should exist. Is there a way around this, I could even manually type in the command stuff but idk.
","upvoteCount":1,"answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"I fixed it kinda i changed how the commands are fetched, changed code. you can interact with it by doing this:
\nconst guildId = await api.getConfig().guildId;\nconst channelId = await api.getConfig().channelId; \nconst cmd = \"command_name\"\nconst command = await api.searchAllSlashCommand(guildId, cmd)\n\nawait api.sendSlashCommand(guildId, channelId, command, (options) or nothing) \n
note that every time searchAllSlashCommand is called it has to parse all the commands on the server so it is more efficient to store the command if you want to use it multiple times.
","upvoteCount":1,"url":"https://github.com/rigwild/discord-self-bot-console/discussions/69#discussioncomment-10238469"}}}-
This was answered in #31 but no longer works,
Command is always undefined even if i know for a fact that command should exist. Is there a way around this, I could even manually type in the command stuff but idk. |
Beta Was this translation helpful? Give feedback.
-
I fixed it kinda i changed how the commands are fetched, changed code. you can interact with it by doing this:
note that every time searchAllSlashCommand is called it has to parse all the commands on the server so it is more efficient to store the command if you want to use it multiple times. |
Beta Was this translation helpful? Give feedback.
I fixed it kinda i changed how the commands are fetched, changed code. you can interact with it by doing this:
note that every time searchAllSlashCommand is called it has to parse all the commands on the server so it is more efficient to store the command if you want to use it multiple times.