Advanced Group Wall Filter: Automated AI Moderation for Your Roblox Group

Hello Roblox developers! I’m excited to share an open-source tool I’ve created to help moderate your group walls automatically. This Group Wall Filter uses advanced techniques (AI + Link Detection + Manual Filter) to detect, log, and remove unwanted posts, making group management easier and more efficient.

View the Code on Github

Features

  • Filters posts based on a customizable list of keywords
  • Detects and removes posts containing links
  • Uses OpenAI’s free moderation API for advanced content analysis. By default it filters hate, harassment, threats, self-harm, sexual content, and violence/gore. This helps supplement areas with more advanced AI detection when Roblox’s filter may fall short. The best part is this API is it is 100% free!
  • Sends notifications to a Discord webhook when posts are removed
  • Whitelist feature for trusted users
  • Caching system to avoid reprocessing posts

Setup Guide

Follow these steps to get the Group Wall Filter up and running for your group:

1. Prerequisites

  • Python installed on your computer.
  • A Roblox account with group management permissions (preferably an alt account for security)
  • (Optional) A Discord server for notifications

2. Environment Setup

  1. Clone the GitHub repository (or download it here):
git clone https://github.com/EDM-Studio/group-wall-filter.git
cd group-wall-filter
  1. Create a virtual environment in the directory:
python -m venv venv
  1. Activate the virtual environment:
  • On Windows: venv\Scripts\activate
  • On macOS/Linux: source venv/bin/activate
  1. Install required packages:
pip install -r requirements.txt

IMPORTANT: Before you can configure your moderation settings, you will need to do two important things.

  1. Get an OpenAI API Key (The API this project uses is free and no payment method is required)
  • First, create an OpenAI account or sign in.
  • Next, navigate to the API key page and “Create new secret key”, optionally naming the key. Make sure to save this somewhere safe and do not share it with anyone.
  1. Find the ROBLOSECURITY cookie for the account you wish to use (must have permission to delete group messages but preferably a dedicated/alt account for security)
  • Open DevTools using F12 or Ctrl+Shift+I (Windows/Linux) or Cmd+Option+I (Mac).
  • Once DevTools is open, use Ctrl+] (Windows/Linux) or Cmd+] (Mac) to cycle through the panels until you reach the Application tab.
  • On the Application tab click Cookies then https://www.roblox.com
  • Look for the cookie named .ROBLOSECURITY and copy the value that appears when you click on it. WARNING: DO NOT SHARE THIS CODE AS IT WILL GIVE SOMEONE ACCESS TO YOUR ACCOUNT!

3. Configuration

  1. Copy or rename the .env.example file to .env.

  2. Replace the placeholders in the .env file with your actual information:

  • your_group_id: The ID of your Roblox group
  • your_roblox_security_cookie: Your Roblox .ROBLOSECURITY cookie (keep this secret!)
  • your_discord_webhook_url: The webhook URL for your Discord channel
  • your_openai_api_key: Your OpenAI API key for content moderation
  • user_id1,user_id2,user_id3: Comma-separated list of whitelisted user IDs (optional)

Note: The WEBHOOK, WEBHOOK_USERNAME, and WEBHOOK_IMAGE fields are optional. If you don’t want to use Discord notifications, you can omit these fields.

4. Running the Filter

  1. Start the Group Wall Filter:
python main.py
  1. The filter will start running, and you should see log messages indicating its activity.
  2. To stop the filter, press Ctrl+C in the terminal.

Customization

You can customize the filter’s behavior by modifying the Config class in the main.py file:

  • filter_list: Add or remove words/phrases to be filtered. Includes a few examples by default but you will likely want to customize and expand on this list as you notice common patterns of rule breaking messages.
  • link_pattern: Modify the regex for link detection (for example you could switch to only disallow certain urls) [Easier customization for URL allowlists/blocklists coming soon!]
  • batchlimit: Change the number of posts fetched in each cycle. By default this is 100.
  • cycle_time: Adjust the time between filter cycles (in seconds). By default this is 60 seconds. If your group is more active you might want to decrease the time between cycle.

Deployment

For long-term deployment, consider using a process manager like systemd (Linux) or running the script as a Windows Service.

Security Considerations

  • Keep your .env file secret and never share it publicly.
  • Regularly rotate your Roblox security cookie.
  • Use a dedicated Roblox account for the filter if possible, to minimize potential security risks.

Troubleshooting

If you encounter any issues:

  1. Check the console output for error messages.
  2. Verify that your .env file is correctly configured.
  3. Ensure your Roblox security cookie is valid and up-to-date (it may invalidate if you change IPs or after a long period of time).
  4. Check your internet connection and firewall settings.
  5. Verify that your OpenAI API key is valid (no credits required).

If you’d like to contribute, the code is open source on Github.

Let me know if you have any questions/have trouble setting it up or have feedback on things you would like to add!

7 Likes

Awesome solution for a Problem every Group has!

2 Likes

Yeah groups have gotten overrun these days (and Roblox has done little to fix the issue) which is unfortunate because they are a great place to get quick user feedback from a larger section of your player base that might not be on other social platforms.

The goal with this program is to hopefully do what Roblox should be doing and actually properly moderate the wall so you can keep your group wall open as a great source of feedback and community :slight_smile:

1 Like