isaacg
isaacg
DIAdiscord.js - Imagine an app
Created by isaacg on 10/26/2023 in #djs-questions
How to end the typing indicator without having to send a message in the channel
You can start the typing indicator for a channel by just doing channel.sendTyping(). You can stop the indicator by either sending a message in the channel or waiting for the 10 second duration to expire, but I need a way to do it without doing either of those (if there is a way) discord version is 14.13.0
4 replies
DIAdiscord.js - Imagine an app
Created by isaacg on 11/18/2022 in #djs-questions
Autocomplete options - what is the value property for?
A related question was asked here: https://discord.com/channels/222078108977594368/1035366885891506278 I'm trying to do the same thing as them (show just one word as an autocomplete option, but when they select the option, it only appends it to the end of their current input), but I have a more specific question. Autocomplete options take an object with required properties name and value, but usually people set them to the same thing, so they don't care about the differences between the properties. Like this:
interaction.respond([{
name: "hello",
value: "hello",
}]);
interaction.respond([{
name: "hello",
value: "hello",
}]);
What I assumed at first was that the name property is displayed to the user, but when they click the option, the value property would replace their input. But that didn't work. After experimenting, I found that the value property actually has no effect whatsoever on the autocomplete interaction. These next two examples have the exact same results - the user sees the name property ("hello") when viewing the autocomplete options, and when clicking it, their input is completely replaced by the name property ("hello").
interaction.respond([{
name: "hello",
value: "hello world",
}]);
interaction.respond([{
name: "hello",
value: "hello world",
}]);
and
interaction.respond([{
name: "hello",
value: "jblaklqwerpoij,a,l1!@#LTQRqnwj",
}]);
interaction.respond([{
name: "hello",
value: "jblaklqwerpoij,a,l1!@#LTQRqnwj",
}]);
So what is the point of the value field? Or is this a bug?
12 replies
DIAdiscord.js - Imagine an app
Created by isaacg on 11/15/2022 in #djs-questions
What are the differences between normal slash commands and autocomplete commands?
Besides the behavioral differences, like autocomplete commands can't be deferred, and autocomplete options can't be made required, etc. when is autocomplete better than a normal slash command with options? Someone explaining autocomplete someone said: "When a user uses a slash command, like 'help', and this command takes a string argument of which command to describe, it might be annoying for the user to know every single command that they can ask for help for. Autocomplete fixes this by suggesting values, in this case, the bot's commands that the user can get help on." But how is this better than using a slash command with a string option that has a predetermined set of choices?
7 replies