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:
parent
cd631dea7b
commit
a717aa0a0e
1 changed files with 2 additions and 0 deletions
2
main.cpp
2
main.cpp
|
@ -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) { \
|
||||
|
|
Loading…
Add table
Reference in a new issue