From 5c3e0b0e80738b06cf49027d621d9e399b370e07 Mon Sep 17 00:00:00 2001 From: Edo Date: Thu, 9 Feb 2023 16:13:47 +0000 Subject: [PATCH] [Discord]: Ignore join requests by default (#766) --- src/Components/Modules/Discord.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Components/Modules/Discord.cpp b/src/Components/Modules/Discord.cpp index ef287a85..c62dd3f4 100644 --- a/src/Components/Modules/Discord.cpp +++ b/src/Components/Modules/Discord.cpp @@ -32,6 +32,12 @@ namespace Components Game::Cbuf_AddText(0, Utils::String::VA("connect %s\n", joinSecret)); } + static void JoinRequest(const DiscordUser* request) + { + Logger::Debug("Discord: Join request from {} ({})\n", request->username, request->userId); + Discord_Respond(request->userId, DISCORD_REPLY_IGNORE); + } + static void Errored(const int errorCode, const char* message) { Logger::Print(Game::CON_CHANNEL_ERROR, "Discord: Error (%i): %s\n", errorCode, message); @@ -120,7 +126,7 @@ namespace Components handlers.disconnected = Errored; handlers.joinGame = JoinGame; handlers.spectateGame = nullptr; - handlers.joinRequest = nullptr; + handlers.joinRequest = JoinRequest; Discord_Initialize("1072930169385394288", &handlers, 1, nullptr);