README - remz_bot.py

==============================================
RetroArch Waiting Games Alerts Bot for Discord
==============================================
by Remz (https://discord.remz.ca)

1. What this bot does
---------------------
This bot posts Waiting Games alerts from https://remz.ca/lobby into your Discord server.
It shows lobby details (game, host, region, core, version, notes, contact) and includes
a "Join Netplay Lobby" button. It can mention a role (like "Waiting Game Alerts") or
fall back to @here.

2. Requirements
---------------
- Python 3.9 or newer installed
- A Discord bot application with a valid bot token
- discord.py library (install with: pip install discord.py)
- requests library (install with: pip install requests)

3. Setup
--------
1. Create a bot in Discord Developer Portal:
   - Go to https://discord.com/developers/applications
   - Click "New Application" → give it a name
   - Go to "Bot" → click "Add Bot"
   - Under "Token", click "Reset Token" → copy the token

2. Invite the bot to your server:
   - In the Developer Portal, go to "OAuth2 → URL Generator"
   - Select "bot" scope
   - Under permissions, check:
     - Send Messages
     - Embed Links
     - Manage Messages (optional, for deleting old alerts)
   - Copy the generated link and open it in your browser
   - Invite the bot to your server

3. Edit the Python file:
   - Open remz_bot.py
   - Replace the placeholder:
     TOKEN = "??????"
     with your actual bot token.

4. Running the bot
------------------
- Open a terminal in the folder containing the bot file
- Run:
  python remz_bot.py

- If you want it to keep running after you close the terminal (Linux VPS):
  nohup python3 remz_bot.py &

5. Configuring alerts
---------------------
Once the bot is online in your server:

- Set the channel where alerts should post:
  !setchannel #channel-name
  Example:
  !setchannel #waiting-games

- Set the role to mention:
  !setrole Role Name
  Example:
  !setrole Waiting Game Alerts

If the role doesn’t exist, the bot will fall back to @here.

6. Notes
--------
- The bot checks the lobby feed every 10 seconds.
- It deletes old alerts when lobbies close.
- Only users with "Manage Server" permission can run !setchannel and !setrole.
- Keep your bot token secret. If it’s ever exposed, reset it immediately in the Developer Portal.