[Discord]: Ignore join requests by default (#766)

This commit is contained in:
Edo 2023-02-09 16:13:47 +00:00 committed by GitHub
parent 0ea7291464
commit 5c3e0b0e80
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);