This tutorial will cover how to set the default value for a select menu (that isn't a text select menu)!
#include <dpp/dpp.h>
#include <dpp/unicode_emoji.h>
int main() {
msg.add_component(
.set_min_values(2)
.set_max_values(2)
)
);
event.reply(msg);
}
});
bot.global_command_create(
dpp::slashcommand(
"select",
"Select something at random!", bot.me.id));
}
});
return 0;
}
The cluster class represents a group of shards and a command queue for sending and receiving commands...
Definition cluster.h:89
Represents the component object. A component is a clickable button or drop down list within a discord...
Definition message.h:497
component & set_id(std::string_view id)
Set the id of the component. For action rows, this field is ignored. Setting the id will auto-set the...
snowflake channel_id
Optional: the channel it was sent from.
Definition appcommand.h:1043
std::string get_command_name() const
Get the command name for a command interaction.
Represents an application command, created by your bot either globally, or on a guild.
Definition appcommand.h:1436
A container for a 64 bit unsigned value representing many things on discord. This value is known in d...
Definition snowflake.h:54
std::function< void(const dpp::log_t &)> DPP_EXPORT cout_logger()
Get a default logger that outputs to std::cout. e.g.
@ cdt_role
Definition message.h:265
auto run_once()
Run some code within an if() statement only once.
Definition once.h:41
@ st_wait
Wait forever on a condition variable. The cluster will spawn threads for each shard and start() will ...
Definition cluster.h:72
@ cot_role_selectmenu
Select menu for roles.
Definition message.h:68
interaction command
command interaction
Definition dispatcher.h:789
Represents messages sent and received on Discord.
Definition message.h:2350
Session ready.
Definition dispatcher.h:1072
User has issued a slash command.
Definition dispatcher.h:806