> For the complete documentation index, see [llms.txt](https://docs.msquared.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.msquared.io/apis-and-tooling/template-web-app/moderation.md).

# Moderation

The admin page gives you access to an example moderation system. Admins can access text message and voice transcription history from worlds started from your organisation.

Admins can also mute and ban players from this page. Messages are checked against a modifiable list of banned profanity (this is stored in [Live Config](/creation/unreal-development/features-and-tutorials/live-config.md)), and offending messages are highlighted in red.

<figure><img src="/files/Dh2anoCHZELK4obz0Si7" alt=""><figcaption><p>The users page, listing all players who have sent a message.</p></figcaption></figure>

To use the admin page you must set up the following:

## 1. Set a database to store messages

1. For this example we will use [Redis Cloud](https://redis.io/try-free/), a free database that allows you to store up to 30MB of data in their Key Value store.
   1. Create an account.
2. Create a new database via the Redis Cloud console.
   1. For the purpose of this example it doesn't matter which cloud vendor or region you choose.
3. Go to <https://cloud.redis.io/#/databases> and select the free database that you just created. This will take you to the database's Configuration tab.
4. Go to the General section and note down these values:
   1. **`REDIS_HOST`:** This will be listed as "Public endpoint" and will look like: `redis-13619.c338.eu-west-2-1.ec2.redns.redis-cloud.com`
      1. It will have a colon and another number at the end of it. Remove that from the vale that you note down.
   2. **`REDIS_PORT`:** This is a subset of Redis Host. It's the number after `redis-` (`13619` in the example above).
5. Go to the Security section and note down these values:
   1. **`REDIS_USERNAME` -** This should be `default`
   2. **`REDIS_PASSWORD`** - This is listed as "default user password".
6. Follow the steps in [Managing environment variables](https://vercel.com/docs/environment-variables/managing-environment-variables) to declare the following values that you just noted down as environment variables in Vercel.

Once set up, all messages sent via your game client will be stored in your Redis database. The template app allows you to configure various settings (such as the max messages to store per world, the time to live for each key stored in Redis, and the key prefix for message values). You can configure these in your app's [constants/config.ts](https://github.com/msquared-io/morpheus-platform-example-app/blob/main/constants/config.ts) file.

## 2. Add your redis to your Unreal project's live config

For moderation to function your Unreal project needs to know where to send messages to. Let's tell the Unreal project about our database.

1. In your IDE, open `Config/LiveConfig/Overrides/game.override.json`
2. Replace its contents with the following:

```json
{
  "Inventory": {
    "HidePlaceMode": true,
    "Quickbar": {
      "GadgetTabSlots": 8,
      "EmoteTabSlots": 8,
      "UsingEquipmentTabs": true
    }
  },
  "Moderation": {
    "ModerationSiteUrl": "http://localhost:3000/api/",
    "UseSpeechToText": true
  }
}
```

3. In this snippet `ModerationSiteUrl` is set as localhost. This means that you can test it against a locally deployed version of [morpheus-platform-example-app](https://github.com/msquared-io/morpheus-platform-example-app).
4. Once you're happy that this works locally, replace `ModerationSiteUrl` with `[your-vercel-app-url]/api/`
5. Follow these steps to deploy a world: [Upload Content](https://docs.msquared.io/creation/unreal-development/getting-started/uploading-content).
   1. This new upload is necessary to update the Live Config that the world will use.
6. Deploy your world.
7. Your new world will have a new `WORLD_ID`. You need to update the `WORLD_ID` [Environment Variable](https://vercel.com/docs/environment-variables/managing-environment-variables) of your Vercel app, then [redeploy](https://vercel.com/docs/deployments/managing-deployments#redeploy-a-project) the app for the variable change to take effect.

You should now see any messages that have been sent come through to your Vercel hosted Moderator app! Messages that are potentially dangerous will be flagged in red.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.msquared.io/apis-and-tooling/template-web-app/moderation.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
