1
0
Fork 0
mirror of https://gitlab.com/niansa/SomeBot.git synced 2025-03-06 20:48:26 +01:00

Fixed crash with zero-name commands

This commit is contained in:
niansa 2022-11-01 16:08:27 +00:00
parent cd631dea7b
commit a717aa0a0e

View file

@ -98,6 +98,7 @@ Bot::Bot(const std::string& token, const std::string& database) : cluster(token)
}
// Add global commands
#define ADD_SC_RESPECTING_CMD_ALIAS_MODE \
if (command.names.empty()) continue; \
switch (config.command_alias_mode) { \
case Config::CommandAliasMode::all: { \
for (const auto& name : command.names) { \
@ -139,6 +140,7 @@ Bot::Bot(const std::string& token, const std::string& database) : cluster(token)
// Add guild commands
#undef ADD_SC_RESPECTING_CMD_ALIAS_MODE
#define ADD_SC_RESPECTING_CMD_ALIAS_MODE \
if (command.names.empty()) continue; \
switch (config.command_alias_mode) { \
case Config::CommandAliasMode::all: { \
for (const auto& name : command.names) { \