Merge pull request #190 from Salanto/fix-DiscordNoContentEmbed
Fix Modcall Embed Construction Order
This commit is contained in:
commit
72aeee3ec0
@ -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.
|
||||
|
@ -17,6 +17,8 @@
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
#include "include/config_manager.h"
|
||||
|
||||
#include <include/config_manager.h>
|
||||
|
||||
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()
|
||||
|
@ -71,9 +71,11 @@ QJsonDocument Discord::constructModcallJson(const QString &f_name, const QString
|
||||
{"description", f_reason}
|
||||
};
|
||||
l_array.append(l_object);
|
||||
|
||||
if (!ConfigManager::discordModcallWebhookContent().isEmpty())
|
||||
l_json["content"] = ConfigManager::discordModcallWebhookContent();
|
||||
l_json["embeds"] = l_array;
|
||||
if (!ConfigManager::discordWebhookContent().isEmpty())
|
||||
l_json["content"] = ConfigManager::discordWebhookContent();
|
||||
|
||||
|
||||
return QJsonDocument(l_json);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user