Skip to content
This repository has been archived by the owner on Mar 5, 2024. It is now read-only.

Commit

Permalink
Hooked up the discord log function.
Browse files Browse the repository at this point in the history
  • Loading branch information
PazerOP committed Jan 7, 2021
1 parent a66171d commit a76de86
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tf2_bot_detector/DiscordRichPresence.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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));
}
Expand Down

0 comments on commit a76de86

Please sign in to comment.