Skip to content
\n

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:

\n
const 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
\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"}}}

How do you send a slash command? #69

Answered by Notmoodo9
Notmoodo9 asked this question in Q&A
Discussion options

You must be logged in to vote

I fixed it kinda i changed how the commands are fetched, changed code. you can interact with it by doing this:

const guildId = await api.getConfig().guildId;
const channelId = await api.getConfig().channelId; 
const cmd = "command_name"
const command = await api.searchAllSlashCommand(guildId, cmd)

await api.sendSlashCommand(guildId, channelId, command, (options) or nothing)   

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.

Replies: 1 comment 9 replies

Comment options

You must be logged in to vote
9 replies
@Daxer1937
Comment options

@Daxer1937
Comment options

@Notmoodo9
Comment options

@Daxer1937
Comment options

@DeadLyBro
Comment options

Answer selected by Notmoodo9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants