diff --git a/core/include/config_manager.h b/core/include/config_manager.h index 9af71b3..edbf931 100644 --- a/core/include/config_manager.h +++ b/core/include/config_manager.h @@ -217,7 +217,7 @@ class ConfigManager { * * @return See short description. */ - static QString discordWebhookContent(); + static QString discordModcallWebhookContent(); /** * @brief Returns true if the discord webhook should send log files. diff --git a/core/src/config_manager.cpp b/core/src/config_manager.cpp index 49e1401..a8ac6be 100644 --- a/core/src/config_manager.cpp +++ b/core/src/config_manager.cpp @@ -17,6 +17,8 @@ ////////////////////////////////////////////////////////////////////////////////////// #include "include/config_manager.h" +#include + QSettings* ConfigManager::m_settings = new QSettings("config/config.ini", QSettings::IniFormat); QSettings* ConfigManager::m_discord = new QSettings("config/discord.ini", QSettings::IniFormat); ConfigManager::CommandSettings* ConfigManager::m_commands = new CommandSettings(); @@ -285,9 +287,9 @@ QString ConfigManager::discordModcallWebhookUrl() return m_discord->value("Discord/webhook_modcall_url", "").toString(); } -QString ConfigManager::discordWebhookContent() +QString ConfigManager::discordModcallWebhookContent() { - return m_discord->value("Discord/webhook_content", "").toString(); + return m_discord->value("Discord/webhook_modcall_content", "").toString(); } bool ConfigManager::discordModcallWebhookSendFile() diff --git a/core/src/discord.cpp b/core/src/discord.cpp index 3fd8e94..d0f093b 100644 --- a/core/src/discord.cpp +++ b/core/src/discord.cpp @@ -71,9 +71,9 @@ QJsonDocument Discord::constructModcallJson(const QString &f_name, const QString {"description", f_reason} }; l_array.append(l_object); + l_json["content"] = ConfigManager::discordModcallWebhookContent(); l_json["embeds"] = l_array; - if (!ConfigManager::discordWebhookContent().isEmpty()) - l_json["content"] = ConfigManager::discordWebhookContent(); + return QJsonDocument(l_json); }