mirror of
https://github.com/EQEmu/Server.git
synced 2026-09-03 21:56:36 +00:00
[Discord] Add Discord webhook callback processing to world (#3322)
This commit is contained in:
@@ -3,6 +3,9 @@
|
||||
|
||||
#include <string>
|
||||
#include "../common/types.h"
|
||||
#include "../common/discord/discord.h"
|
||||
|
||||
extern UCSConnection UCSLink;
|
||||
|
||||
class WorldBoot {
|
||||
public:
|
||||
@@ -16,6 +19,16 @@ public:
|
||||
static bool DatabaseLoadRoutines(int argc, char **argv);
|
||||
static void CheckForPossibleConfigurationIssues();
|
||||
static void Shutdown();
|
||||
static void SendDiscordMessage(int webhook_id, const std::string& message);
|
||||
static void DiscordWebhookMessageHandler(uint16 log_category, int webhook_id, const std::string &message)
|
||||
{
|
||||
std::string message_prefix = fmt::format(
|
||||
"[**{}**] **World** ",
|
||||
Logs::LogCategoryName[log_category]
|
||||
);
|
||||
|
||||
SendDiscordMessage(webhook_id, message_prefix + Discord::FormatDiscordMessage(log_category, message));
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user