mortovekingjulien

Make me a bot that pings a role when the roblox game +1 keyboard escape has a secret or normal admin abuse

Kodari AI
KodariJun 20 at 7:55 pm 12
KeyboardEscapeMonitor
A Discord bot that monitors the Roblox game "+1 Keyboard Escape" for admin activity (both secret and normal admin abuse). Uses the Roblox Presence & Games API to track when configured admin Roblox accounts enter the game, then pings a designated Discord role with details. Includes slash commands to configure the alert channel, ping role, and list of admin Roblox user IDs to watch. Polling runs on a background task loop.

Here’s the plan:

  • bot.py — entry point, loads cogs

  • cogs/monitor.py — background task polling Roblox Presence API for admin users in-game

  • cogs/setup.py — slash commands to configure channel, role, and admin watchlist

  • config.json — persistent guild config

  • .env + requirements.txt


Setup Guide

1. Install dependencies

Shell
pip install -r requirements.txt

2. Add your bot token

Edit .env:

Plain Text
DISCORD_TOKEN=your_actual_token_here

3. Run the bot

Shell
python bot.py

4. Configure in Discord (all admin-only)

Command
Description
/setchannel #channel
Where alerts get posted
/setrole @role
Role that gets pinged
/addadmin <roblox_id> <label> <type>
Add an admin to watch (
normal
or
secret
)
/removeadmin <roblox_id>
Remove from watchlist
/listadmins
See all watched accounts
/monitorstatus
Check setup status

How it works

Every 30 seconds the bot pings the Roblox Presence API to check if any of your watched Roblox user IDs are currently in +1 Keyboard Escape (Place ID: 5507622398). When one is detected, it sends an embed to your alert channel and pings your role. It won’t re-alert for the same session — only when they leave and rejoin.

Note: You need to add the specific Roblox user IDs of known admins to monitor. You can find a Roblox user ID by visiting roblox.com/users/USERID/profile or using the Roblox website’s profile page URL.

Kodari can make mistakes. Review important code before using.
Files
cogs
bot.py
config.json
requirements.txt
Code
5 389
bot.py
import discord
from discord.ext import commands
import os
import json
import logging
from dotenv import load_dotenv

load_dotenv()

logging.basicConfig(
    level=logging.INFO,
    format="%(asctime)s [%(levelname)s] %(name)s: %(message)s"
)
log = logging.getLogger("bot")

CONFIG_PATH = "config.json"

def load_config():
    if not os.path.exists(CONFIG_PATH):
        return {}
    with open(CONFIG_PATH, "r") as f:
        return json.load(f)

def save_config(data: dict):
    with open(CONFIG_PATH, "w") as f:
        json.dump(data, f, indent=2)

intents = discord.Intents.default()
intents.guilds = True

bot = commands.Bot(command_prefix="!", intents=intents)
bot.config_path = CONFIG_PATH
bot.load_config = load_config
bot.save_config = save_config

PLACE_ID = 5507622398

@bot.event
async def on_ready():
    log.info(f"Logged in as {bot.user} (ID: {bot.user.id})")
    try:
        synced = await bot.tree.sync()
        log.info(f"Synced {len(synced)} slash commands.")
    except Exception as e:
        log.error(f"Failed to sync commands: {e}")

async def main():
    async with bot:
        await bot.load_extension("cogs.monitor")
        await bot.load_extension("cogs.setup")
        await bot.start(os.getenv("DISCORD_TOKEN"))

if __name__ == "__main__":
    import asyncio
    asyncio.run(main())