diff --git a/tf2_bot_detector/DiscordRichPresence.cpp b/tf2_bot_detector/DiscordRichPresence.cpp index ad406485..ffa85e56 100644 --- a/tf2_bot_detector/DiscordRichPresence.cpp +++ b/tf2_bot_detector/DiscordRichPresence.cpp @@ -105,6 +105,11 @@ static auto DiscordDebugLog(const mh::source_location& location, DebugLog(DISCORD_LOG_COLOR, location, "DRP: {}", mh::format(fmtStr, args...)); } +static void DiscordLogHookFunc(discord::LogLevel level, const char* logMsg) +{ + DebugLog(DISCORD_LOG_COLOR, logMsg); +} + namespace { enum class ConnectionState @@ -890,6 +895,8 @@ void DiscordState::Update() { m_Core.reset(core); + core->SetLogHook(discord::LogLevel::Debug, &DiscordLogHookFunc); + if (auto result = m_Core->ActivityManager().RegisterSteam(440); result != discord::Result::Ok) LogError("Failed to register discord integration as steam appid 440: {}", mh::enum_fmt(result)); }