mirror of
https://gitlab.com/niansa/SomeBot.git
synced 2025-03-06 20:48:26 +01:00
Respect CommandAliasMode in help command
This commit is contained in:
parent
c470c87948
commit
9634a3c913
2 changed files with 15 additions and 5 deletions
|
@ -109,11 +109,21 @@ public:
|
|||
.set_footer(dpp::embed_footer().set_text("Bot entwickelt von 353535#3535"));
|
||||
for (const auto& command : bot->get_commands().chat_commands) {
|
||||
std::string nameCollection;
|
||||
for (const auto& name : command.names) {
|
||||
nameCollection.append(name);
|
||||
nameCollection.push_back('/');
|
||||
switch (bot->config.command_alias_mode) {
|
||||
case Bot::Config::CommandAliasMode::all: {
|
||||
for (const auto& name : command.names) {
|
||||
nameCollection.append(name);
|
||||
nameCollection.push_back('/');
|
||||
}
|
||||
nameCollection.pop_back();
|
||||
} break;
|
||||
case Bot::Config::CommandAliasMode::first: {
|
||||
nameCollection = command.names.front();
|
||||
} break;
|
||||
case Bot::Config::CommandAliasMode::last: {
|
||||
nameCollection = command.names.back();
|
||||
} break;
|
||||
}
|
||||
nameCollection.pop_back();
|
||||
embed.add_field(nameCollection, command.description, true);
|
||||
}
|
||||
event.reply(dpp::message().add_embed(embed).set_flags(dpp::message_flags::m_ephemeral));
|
||||
|
|
|
@ -81,7 +81,7 @@ class Levels {
|
|||
.set_color(color);
|
||||
return base_msg.add_embed(embed);
|
||||
} else {
|
||||
return base_msg.set_content(msg_str);
|
||||
return base_msg.set_content(msg_str).set_allowed_mentions(false, false, false, false, {}, {});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue