Skip to main content
This guide will walk you through integrating and managing content moderation for your game when using the Discord Social SDK.

Overview

Effective moderation is essential for creating healthy social experiences. This guide will help you:
  • Better understand your moderation responsibilities
  • Implement client-side moderation for text and audio content alongside the Discord Social SDK

Prerequisites

Before you begin, make sure you have:

Your Moderation Responsibilities

Moderation on Discord

Discord’s Community Guidelines and Terms of Service apply to any content that is rendered on Discord, including:
  • Text messages, audio, and video sent within Discord’s platform
  • Text messages that are appear on Discord (such as in DMs or Linked Channels) after being sent by players in your game (whether they have linked their Discord account or are using a provisional account)
Discord can take various actions against such content on Discord for violating its terms or policies, including through Discord platform-wide account bans and restrictions. Actions against a player’s Discord account will not affect their separate account in the game (see below for more details); however, if a player’s Discord account is banned, they will no longer have access to the SDK features that require an account connection.

Game Developer’s Responsibility

Your terms and policies apply to the content in your game. You are responsible for:
  • Ensuring you comply with the Discord Social SDK Terms
  • Creating game-specific content policies and enforcing them
  • In-game content moderation for messages or audio within your game
  • Implementing appropriate UIs for reporting and moderation; this includes providing players a way to report issues or violations of your policies and reviewing and taking appropriate action on such reports

Client-Side Chat Moderation

While the Social SDK does not have a direct integration with external moderation toolkits, a client side approach to outgoing and incoming messages can be implemented when sending messages through Client::SendUserMessage and/or receiving them through Client::SetMessageCreatedCallback.

How it works:

An example moderation integration would be the following: Message Sending
  • Before a user sends a message, your client validates it with your backend
  • If it passes validation, the message is sent through the SDK
  • Messages can be optimistically rendered while validation occurs
// Example: Validating a message before sending
void validateAndSendMessage(const std::string& message) {
    // Optimistically render the message immediately
    renderMessage(myUserId, message);

    // Send to backend for validation
    myBackend->validateMessage(message, [this, message](bool isValid, std::string moderated) {
        if (isValid) {
            // Send through Discord SDK
            client->SendUserMessage(recipientId, message, [](auto result, uint64_t messageId) {
		  if (result.Successful()) {
		    std::cout << "✅ Message sent successfully\n";
		  } else {
		    std::cout << "❌ Failed to send message: " << result.GetError() << "\n";
		  }
	});
        } else {
            // Remove the invalid message from UI and notify user
            removeMessage(myUserId, message);
            notifyUser("Message violated content policy");
        }
    });
}
Message Receiving
  • When a message is received from players within Discord or a Game Client, your client sends it to your backend for validation
  • Once validation succeeds, render the message in the game
Depending on how long your content moderation processing takes, you may wish to optimistically render the incoming message, and remove or alter it if your moderation service deems it appropriate. However, this does pose the risk of temporarily exposing content to your game players that does not align with your moderation policies.
You may wish to implement moderation caching on your backend to avoid redundant validation. This is especially true for lobby messages, which are sent to multiple recipients.
As a reminder, you are responsible for any third-party moderation toolkits or services you use for your game and will ensure you comply with any applicable terms and laws, including obtaining consents from players as necessary for processing their data using such moderation services.

Handling Users with Banned Discord Accounts

Discord Platform Bans

If a player has connected their Discord account with your game, and it is banned, their Client will be immediately disconnected, and that user will no longer be able to authenticate through Discord.
The recommended path for integrating the Discord Social SDK is that your game has a primary authentication other than Discord that initially sets up a provisional account, and have the player link their Discord account to this primary authentication. This approach protects your users’ game access and data if they encounter issues with their Discord account, such as a permanent or temporary ban. To implement this recommended path:
  1. Create an account through a non-Discord authentication provider, and create a provisional account attached to it.
  2. When users later authenticate through Discord to link their account, have your game back end execute the merge their provisional account with their Discord Account.
  3. The account merging process will internally store the externalAuthToken from the provisional account against their Discord account. If a ban of the Discord account happens, that externalAuthToken will be attached to the new provisional account that is created in its stead, with the original Discord account’s in-game friends, and will be available through the authentication provider the account was initially setup with.
  4. As a last step, your game back end should maintain the record of the externalAuthToken against the user account, even after the account merging process, since it will be needed to authenticate via a provisional account should Discord authentication fails for a ban, or any other reason.
If you use Discord as the primary or sole authentication mechanism for your game, you risk players permanently losing access to their in-game data if their Discord account is banned, as there is no way to migrate them to a provisional account that is connected to an external authentication provider.
At this time, there is no API to look up if a player’s Discord account has been banned.

Discord Server Bans

If you wish to tie your in-game moderation policies to a specific Discord server that you own, such as your official community server, you are able to retrieve ban information for your Discord Server via our REST APIs. See the references for the REST endpoints{guild.id}/guilds/{guild.id}/bans or /guilds/{guild.id}/bans/{user.id} for more information on retrieving all bans for your guild, or ban information for a specific user within your guild.

Voice Chat Moderation

The Discord Social SDK provides access to audio streams for in-game voice calls, allowing you to implement audio moderation for your game’s voice chat functionality. The data for the call is available through Client::StartCallWithAudioCallbacks, and can be passed to your voice moderation system.
// Example: Capturing local voice chat audio for asynchronous moderation.

// Callback for local users' audio with moderation
auto capturedCallback = [](int16_t const* data,
                     uint64_t samplesPerChannel, int32_t sampleRate,
                     uint64_t channels) {
    // Call the moderation function
    moderateCapturedVoice(data, samplesPerChannel);
};

// Start the call with our moderation callback
auto call = client->StartCallWithAudioCallbacks(lobbyId, receivedCallback, capturedCallback);

Next Steps

Need help? Join the Discord Developers Server and share questions in the #social-sdk-dev-help channel for support from the community. If you encounter a bug while working with the Social SDK, please report it here: https://dis.gd/social-sdk-bug-report

Change Log

DateChanges
May 22, 2025initial release