🧩Riddles
Games & Puzzles
📋 Overview
The Riddles module provides a server-wide riddle challenge system where members collaborate to solve brain teasers. The system features riddles loaded from a curated JSON file, hint system revealing letters one at a time (3 hints per riddle), fuzzy matching for answer verification (75% similarity threshold), server-wide participation with one active riddle at a time, cooldowns to prevent spam, administrator controls for revealing answers or stopping riddles, and persistent tracking to prevent duplicate riddles. The system encourages community cooperation and friendly competition.
⚙️ How It Works
Riddle System: When a riddle starts, a random brain teaser is selected from riddles.json and posted to the server. The riddle becomes the server's active challenge, with only one riddle active at a time. All members can see the riddle and submit answers, but only the correct answer (or very close matches) will solve it.
Answer Verification: Answers are checked using fuzzy matching (75% similarity threshold) to account for minor spelling variations or formatting differences. This allows answers like "a towel" to match "towel" or "The Towel" to match "towel". When solved, the winner is announced publicly with congratulations.
Hint System: Members can request hints that reveal individual letters of the answer:
3 hints available per riddle
Each hint reveals one random unrevealed letter
Letters shown as: "_ o _ _ l" (spaces between each position)
Unrevealed letters shown as underscores
Once all letters revealed, no more hints available
Hint cooldown: 10 minutes (3 uses per member)
Riddle Management:
Start: Creates new riddle challenge (5-minute cooldown)
Submit: Attempts to solve current riddle
Hint: Reveals one letter (10-minute cooldown, 3 uses)
Show: Displays current riddle again
Reveal: Shows answer (admin only)
Stop: Ends current riddle (30-second cooldown)
State Tracking:
Active riddle stored in database with answer
Letter reveal tracking prevents duplicate hints
Hint counter resets per riddle
Code system tracks if riddle is active (0=new, 1=active)
"none" indicates no active riddle
🔑 Key Commands
/riddle start
/riddle startDescription: Create a new riddle challenge for members to solve Access: All members Cooldown: 5 minutes Function: Selects random riddle from database, posts to channel, marks as active, initializes hint tracking, clears previous letter reveals. Cannot start if riddle already active.
Process:
Loads random riddle from riddles.json
Saves riddle and answer to database
Sets code to 1 (active)
Initializes answer letter tracking
Resets shown letters index
Posts riddle to channel
Members can now submit answers and request hints
/riddle submit <guess>
/riddle submit <guess>Description: Submit your answer attempt for the active riddle Access: All members Cooldown: None Parameters:
guess: Your answer to the riddle (text input)
Function: Checks your answer against the correct answer using 75% fuzzy matching. If correct (≥75% similarity), announces winner and deactivates riddle. If incorrect, shows error message with your guess.
Success Message:
Failure Message:
No Active Riddle:
/riddle hint
/riddle hintDescription: Request a hint to help solve the current riddle Access: All members Cooldown: 10 minutes per member (3 uses) Function: Reveals one random unrevealed letter from the answer. Shows answer format with revealed letters and underscores. Tracks hint count (3 maximum per riddle). Cooldown resets if no active riddle.
Hint Display:
Hint Mechanics:
Reveals letters one at a time
Random selection from unrevealed letters
Spaces between each character position
Underscores for hidden letters
Tracks which letters already shown
3 hints total per riddle
Cooldown: 10 minutes per member
All Letters Revealed:
/riddle show
/riddle showDescription: Display the current riddle again for reference Access: All members Cooldown: None Function: Reposts the current active riddle. Useful if riddle scrolled out of view or new members joined. Shows error if no active riddle.
Display:
Reposts original riddle text
No embed formatting
Plain text message
Identical to original post
/riddle reveal
/riddle revealDescription: Reveal the riddle answer (Administrator only) Access: Administrator permission required Cooldown: None Function: Shows the correct answer to the active riddle without solving it. Riddle remains active after reveal. Useful for time management or stuck riddles.
Reveal Display:
Note: Does not end riddle or award points. Riddle stays active until solved or stopped.
/riddle stop
/riddle stopDescription: Terminate the current active riddle session Access: All members Cooldown: 30 seconds Function: Ends the current riddle without solving it. Resets system for new riddle. Sets riddle to "none" in database. Clears hint tracking.
Stop Message:
Use Cases:
Riddle too difficult
Want different riddle
Time to move on
Riddle unsolvable
👥 Who It's For
All Members: Can use start, submit, hint, show, and stop commands
Puzzle Solvers: Engage brain with challenging riddles
Collaborative Players: Work together using hints
Competitive Members: Race to solve first
Administrators: Can reveal answers when needed
💡 Why This Feature
Encourages community collaboration on shared challenges. Provides intellectual engagement beyond typical chat. Creates friendly competition for solving speed. Hint system prevents frustration while maintaining challenge. Server-wide riddle fosters unity around common goal. Fuzzy matching reduces frustration with minor errors. Public announcements celebrate winners. Multiple management commands provide flexibility. Cooldowns prevent spam while allowing participation. Suitable for all ages and interests. Breaks up conversation with mental challenges. Easy to jump in and participate. Stored riddles prevent repetition.
Made by DIVINITY • Pleasure Corner
Last updated
Was this helpful?