Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
063b68f
279-Bug fix quest progress counting in restricted channels
RemainingDelta May 30, 2026
ba3b435
Merge pull request #286 from RemainingDelta/279-Bug
RemainingDelta May 30, 2026
0e1a15a
285-Enhancement add budget reset date to check-budget command embed
RemainingDelta May 30, 2026
1acd97c
Merge pull request #287 from RemainingDelta/285-Enhancement
RemainingDelta May 30, 2026
1d687a8
277-Feature add /version slash command with embed display
RemainingDelta May 30, 2026
339213e
Merge pull request #288 from RemainingDelta/277-Feature
RemainingDelta May 30, 2026
62b8ace
278-Enhancement restrict !starttourney and !endtourney to tourney adm…
RemainingDelta May 30, 2026
538cd92
Merge pull request #289 from RemainingDelta/278-Enhancement
RemainingDelta May 30, 2026
a4d1036
265-Enhancement add response time duration to hacked user flag embed
RemainingDelta May 30, 2026
2002555
Merge pull request #290 from RemainingDelta/265-Enhancement
RemainingDelta May 30, 2026
38292ff
251-Enhancement add moderator identity to hacked command embed
RemainingDelta May 30, 2026
85fb4fc
Merge pull request #291 from RemainingDelta/251-Enhancement
RemainingDelta May 30, 2026
9106e15
292-Enhancement update README and help commands with accurate documen…
RemainingDelta May 31, 2026
491d670
Merge pull request #293 from RemainingDelta/292-Enhancement
RemainingDelta May 31, 2026
538b1fa
294-Feature add poll rewards command for distributing tokens to poll …
RemainingDelta Jun 3, 2026
ccb2a68
Merge pull request #295 from RemainingDelta/294-Feature
RemainingDelta Jun 3, 2026
3860976
301-Enhancement restrict passive token earning, quest progress, and d…
RemainingDelta Jun 12, 2026
751028a
Merge pull request #302 from RemainingDelta/301-Enhancement
RemainingDelta Jun 12, 2026
1d01484
300-Bug fix handle Gemini API failure in GitHub issue creation confir…
RemainingDelta Jun 12, 2026
f4f4053
Merge pull request #303 from RemainingDelta/300-Bug
RemainingDelta Jun 12, 2026
043c4d0
299-Bug fix floating-point display in redemption ticket balance fields
RemainingDelta Jun 12, 2026
0793e99
Merge pull request #304 from RemainingDelta/299-Bug
RemainingDelta Jun 12, 2026
0920f05
298-Bug fix command failing for users who have left the server
RemainingDelta Jun 12, 2026
883de2f
Merge pull request #305 from RemainingDelta/298-Bug
RemainingDelta Jun 12, 2026
12a16d3
297-Feature add sticky messages feature with debounced repost and per…
RemainingDelta Jun 12, 2026
7eee63c
Merge pull request #306 from RemainingDelta/297-Feature
RemainingDelta Jun 12, 2026
9b03eab
296-Bug fix redeem ticket channel not pinging the redeeming user
RemainingDelta Jun 12, 2026
5271f22
Merge pull request #307 from RemainingDelta/296-Bug
RemainingDelta Jun 12, 2026
3a3de48
220-Feature add counting game feature with sequential validation and …
RemainingDelta Jun 12, 2026
03ce6fe
Merge pull request #308 from RemainingDelta/220-Feature
RemainingDelta Jun 12, 2026
8151184
309-Feature add /active-matches command to display all active match s…
RemainingDelta Jun 12, 2026
e3333e9
Merge pull request #310 from RemainingDelta/309-Feature
RemainingDelta Jun 12, 2026
71c012b
199-Enhancement add translation embed capture to ticket transcripts
RemainingDelta Jun 12, 2026
53f6ca2
Merge pull request #311 from RemainingDelta/199-Enhancement
RemainingDelta Jun 12, 2026
450409a
201-Feature add transcript generation to redemption ticket close flow
RemainingDelta Jun 14, 2026
c163890
Merge pull request #313 from RemainingDelta/201-Feature
RemainingDelta Jun 14, 2026
943ca01
202-Bug fix bracket progress showing wrong round numbers
RemainingDelta Jun 14, 2026
b4737bc
Merge pull request #314 from RemainingDelta/202-Bug
RemainingDelta Jun 14, 2026
e1eddbe
198-Bug improve match history to show pending matchups instead of hid…
RemainingDelta Jun 14, 2026
962dd5b
198-Bug fix entrantSources lookup using entrantId matching instead of…
RemainingDelta Jun 14, 2026
e1aa714
198-Bug update TBD slot display with source match score and teams
RemainingDelta Jun 14, 2026
ed7f8fc
Merge pull request #315 from RemainingDelta/198-Bug
RemainingDelta Jun 15, 2026
5cc6ced
312-Feature add monthly tournament reports, auto-detect Matcherino ID…
RemainingDelta Jun 20, 2026
d47690c
312-Feature add tests for tourney reports pure functions and schedule…
RemainingDelta Jun 20, 2026
18fe787
Merge pull request #319 from RemainingDelta/312-Feature
RemainingDelta Jun 20, 2026
7797c14
316-Enhancement remove 5-match bottleneck cap
RemainingDelta Jun 20, 2026
0ead0f4
Merge pull request #320 from RemainingDelta/316-Enhancement
RemainingDelta Jun 20, 2026
4974f32
318-Enhancement replace previous cleanup warning instead of stacking …
RemainingDelta Jun 20, 2026
a01da8f
Merge pull request #321 from RemainingDelta/318-Enhancement
RemainingDelta Jun 20, 2026
2786a3a
317-Enhancement add slow mode auto-disable after 1 hour with general …
RemainingDelta Jun 20, 2026
85e3769
Merge pull request #322 from RemainingDelta/317-Enhancement
RemainingDelta Jun 20, 2026
78da21b
184-Bug fix quest rewards to better incentivize harder quests
RemainingDelta Jun 20, 2026
4e12202
Merge pull request #323 from RemainingDelta/184-Bug
RemainingDelta Jun 20, 2026
41af5c3
200-Feature add megabox quest type with dedicated daily and weekly qu…
RemainingDelta Jun 21, 2026
f7ad760
Merge pull request #324 from RemainingDelta/200-Feature
RemainingDelta Jun 21, 2026
db46b21
325-Enhancement update README and help commands for v1.10.0
RemainingDelta Jun 21, 2026
07de2c1
Merge pull request #328 from RemainingDelta/325-Enhancement
RemainingDelta Jun 21, 2026
245354a
327-Enhancement bump version to v1.10.0
RemainingDelta Jun 21, 2026
a58d68d
Merge pull request #330 from RemainingDelta/327-Enhancement
RemainingDelta Jun 21, 2026
c201cfe
326-Enhancement add unit tests for TIMEZONE_ALIASES and convert_time …
RemainingDelta Jun 21, 2026
0eb9327
Merge pull request #331 from RemainingDelta/326-Enhancement
RemainingDelta Jun 21, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 42 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Overview
**Name:** Remaining7 Discord Bot
**Version:** v1.7.5
**Version:** v1.10.0
**Contributors:** remainingdelta, nightwarrior5
**Objective:** A feature-rich Discord bot for the Remaining7 community server (16k+ members). Handles an R7 Token economy, leveling, quests, a Brawl Stars collection minigame, tournament management with Matcherino integration, support tickets, event operations, a security protocol, and multi-language translation.
**Server Link:** https://discord.gg/6MzrjS2X8k
Expand All @@ -15,6 +15,7 @@
- **Database:** MongoDB Atlas via `motor` (async)
- **Translation:** `deep-translator` + `langdetect`
- **External API:** Matcherino (tournament brackets, payouts)
- **AI Integration:** Gemini API (GitHub issue generation)
- **Linting:** Ruff (`ruff check .` / `ruff format .`)

---
Expand All @@ -23,7 +24,10 @@
```
Remaining7-Discord-Bot/
├── main.py # Entry point — loads cogs, syncs commands
├── pyproject.toml # Project metadata and version
├── requirements.txt
├── Makefile
├── LICENSE
├── .env.example
├── .gitignore
├── CLAUDE.md
Expand All @@ -36,9 +40,12 @@ Remaining7-Discord-Bot/
│ ├── quests.py # Daily & weekly quest system
│ ├── security.py # Hacked protocol (timeout, purge, flag)
│ ├── event.py # Event channel cleanup & reward payouts
│ ├── general.py # /help, /mod-help, /admin-help, /convert-time
│ ├── general.py # /help, /mod-help, /admin-help, /version, /convert-time
│ ├── translation.py # !t prefix & /translate slash command (55 languages)
│ ├── counting.py # Sequential counting game with /set-count
│ ├── sticky.py # !sticky / !unsticky persistent channel messages
│ ├── support_tickets.py # General support tickets (issues, support, apps, partnership)
│ ├── github_tickets.py # AI-powered GitHub issue creation from tickets (Gemini)
│ ├── ticket_command_router.py # Shared routing for tourney & support ticket commands
│ ├── brawl/
│ │ ├── brawlers.json # Brawler data (name, rarity, gadgets, star powers, hypercharges)
Expand All @@ -64,7 +71,7 @@ Remaining7-Discord-Bot/
## Core Features

### R7 Token Economy
- **Passive Income:** Users earn 2–5 R7 Tokens per message (20-second cooldown). Server Boosters get a 2% average bonus.
- **Passive Income:** Users earn 2–5 R7 Tokens per message (20-second cooldown). Server Boosters get a 5% increase in tokens on average.
- **Daily Rewards:** `/daily` grants 80–160 tokens (scaled by level). Requires 5 messages sent since last claim and a 24-hour cooldown.
- **Supply Drop:** `/drop <amount>` (Admin) to force a token drop in general chat.
- **Balance & Ranking:** `/balance [user]`, `/leaderboard [page]`.
Expand All @@ -86,10 +93,14 @@ Remaining7-Discord-Bot/
- `/levels-leaderboard [page]` — server-wide level rankings (paginated).

### Quest System
- **Daily Quests:** 80 / 160 / 240 messages → 50–100 tokens + 200–300 XP.
- **Weekly Quests:** 500 / 750 / 1000 messages → 250–600 tokens + 1000–3000 XP.
- `/quests` — interactive progress bars for active quests.
- Quests auto-assign randomly; completion rewards are granted instantly.
Every user always has **4 active quests** — one daily and one weekly per category:
- **Daily Message Quests:** 80 / 160 / 240 messages → 50 / 115 / 250 tokens + 100 / 200 / 300 XP.
- **Weekly Message Quests:** 500 / 750 / 1000 messages → 225 / 400 / 640 tokens + 1000 / 2000 / 3000 XP.
- **Daily Megabox Quest:** Open 100 Mega Boxes or Starr Drops → 50 tokens + 100 XP.
- **Weekly Megabox Quest:** Open 500 Mega Boxes or Starr Drops → 250 tokens + 500 XP.
- `/quests` — interactive progress bars for all 4 active quests.
- `/reset-quests <user>` (Admin) — force-reset a user's quest assignments.
- Quests auto-assign randomly per slot; completion rewards are granted instantly.

### Brawl Stars Collection Minigame
- **Gacha Drops:**
Expand Down Expand Up @@ -130,6 +141,9 @@ Remaining7-Discord-Bot/
- **Rate Limits:** Max 3 open tickets per user, 180s cooldown. Auto-reopen after 6-hour lock.
- **Auto-translation:** Ticket messages auto-translated via `deep-translator` + `langdetect`.
- **Test Mode:** `/tourney-test-mode` — toggle 100-ticket limit and 0.1s cooldown for testing.
- **Active Matches:** `/active-matches` — display all active match scores grouped by round.
- **Monthly Reports:** Auto-generated monthly tournament reports posted to a dedicated archive channel. Matcherino ID is auto-detected on `!starttourney`.
- **Slow Mode:** `!starttourney` enables 60s slow mode in general chat with a public notice; auto-removed after 1 hour (or immediately on `!endtourney`).
- **Staff Guide:** `/tourney-admin-help`.
- **SA Mode:** South America region variant with separate ticket categories and region-specific workflow.

Expand All @@ -150,11 +164,17 @@ Remaining7-Discord-Bot/
- Staff can close, reopen, and delete tickets with transcript generation.
- Transcripts DM'd to the opener and archived in a log channel.

### GitHub Ticket Integration
- AI-powered GitHub issue creation from support tickets using Gemini.
- Automatically generates structured bug reports, feature requests, and enhancement issues from ticket conversations.
- Requires `GEMINI_TOKEN` and `GITHUB_TOKEN` environment variables.

### Event Management
- **Automated Monitoring:** Daily background task at 12:00 AM ET scans event channels.
- **Smart Alerts:** Alert sent when messages are 7+ days old (prevents exceeding Discord's 14-day bulk-delete limit).
- **Smart Alerts:** Alert sent when messages are 7+ days old (prevents exceeding Discord's 14-day bulk-delete limit). Previous day's alert is replaced instead of stacking.
- **Manual Cleanup:** `/clear-red`, `/clear-blue`, `/clear-green` for instant channel wipes.
- **Reward Payouts:** `/event-rewards <message_id>` parses `@User 500` format to batch-distribute tokens with confirmation.
- **Poll Rewards:** `/poll-rewards <message_id>` distributes tokens to all users who voted on a poll.
- **Staff Guide:** `/event-staff-help`.

### Security Protocol
Expand All @@ -168,8 +188,17 @@ Remaining7-Discord-Bot/
- `/translate <language> <phrase>` — translate English text into any of 55 supported languages.
- Auto-detects source language. Google Translate backend.

### Counting Game
- Sequential counting game in a designated channel — users must send the next number in sequence.
- `/set-count <number>` (Staff) — manually set the current count.

### Sticky Messages
- `!sticky <message>` — pin a message that reposts automatically when other messages are sent.
- `!unsticky` — remove the active sticky message from a channel.

### Utility
- `/convert-time <date> <time> <timezone>` — convert a date and time to all Discord timestamp formats. Supports 20+ timezone aliases (EST, PT, GMT, etc.) and IANA names.
- `/version` — view the bot's current version.

### Help Commands
- `/help` — user command directory.
Expand Down Expand Up @@ -206,10 +235,12 @@ This bot requires **Python 3.10+** and a **MongoDB Atlas** database.
PROD_TOKEN= # Production bot token (used when BOT_MODE=PROD)
DEV_TOKEN= # Dev/test bot token (used when BOT_MODE=DEV)
MONGO_URI= # MongoDB Atlas connection string
GEMINI_TOKEN= # Gemini API key for AI-powered GitHub issue creation
GITHUB_TOKEN= # GitHub PAT with 'repo' scope for issue creation
```

4. **Update Configuration**
Verify and update IDs in `features/config.py` (channels, roles, categories, emojis) for your server. Both `REAL` and `TEST` branches must be maintained.
Verify and update IDs in `features/config.py` (channels, roles, categories, emojis) for your server. Both `PROD` and `DEV` branches must be maintained.

5. **Run the Bot**
```bash
Expand Down Expand Up @@ -244,8 +275,8 @@ Uses MongoDB database `r7_bot_db` with the following collections:

| Task | Schedule | Description |
|---|---|---|
| Message listener | On every message | Passive token + XP generation (20s cooldown) |
| Quest tracker | On every message | Track quest progress, auto-complete and reward |
| Message listener | On every message | XP generation; passive token earning restricted to general chat (20s cooldown) |
| Quest tracker | On every message / megabox open | Track message & megabox quest progress, auto-complete and reward |
| Event cleanup | Daily at 12:00 AM ET | Scan event channels for stale messages |
| Queue dashboard | Every 15 seconds | Update tourney queue embed during live tournaments |
| Supply drop | Every 6 hours | Random token drop in general chat |
Expand Down
Loading
Loading