Guess the number
Select a number and let your users guess.
Features
- Admins can manually create guess-the-number game sessions in any channel.
- Optional game channel mode that automatically starts a new game when the previous one is solved.
- Users guess by typing numbers in the channel; the bot reacts to indicate correct, wrong, or invalid guesses.
- Optional higher/lower hint reactions on wrong guesses.
- Configurable start and end messages.
- Channel locking after a game ends (in non-game-channel mode) to prevent further messages.
Setup
- Enable the module in your SCNX dashboard.
- Open the configuration and add admin roles that are allowed to create and manage game sessions.
- Make sure the bot has the "Manage Channels", "Manage Roles", "Add Reactions", and "Read Message History" permissions in the channels where games will be played.
- Optionally, enable the game channel mode for automatic game restarts.
Usage
Manual games
Admins (users with a configured admin role) can create a game session in any channel using /guess-the-number create. Once started, users guess by sending numbers in the channel. The bot reacts to each guess:
- A check mark for the correct number (the game ends and the winner is announced).
- A cross for a wrong guess, or up/down arrows if higher/lower reactions are enabled.
- A no-entry sign for invalid input (not a number or outside the min/max range).
- A stop sign if an admin tries to guess (admins cannot participate in manual games).
After a game ends, the channel is locked. Admins can also end a game early with /guess-the-number end or check the current game state with /guess-the-number status.
Game channel mode
When game channel mode is enabled, a dedicated channel is used where games automatically restart after the previous one is solved. Everyone, including admins, can participate in game channel games. The /guess-the-number command cannot be used in the game channel.
Commands
name:<Type> is an option of a slash-command with name name and the type Type. Options that not required, are described as [name:<Type>]. If the action of a command is vastly different between required and not-required options, we might list them separately.Examples
/moderate ban user:<Member>: This command (/moderate ban) has an required option with the name "user" that only accepts one member as a value./moderate ban victim:<Member> reason:<Text>: This command (/moderate ban) has an required option with the name "victim" that only accepts one member as a value and another required option with the name "reason" that accepts any text as an value./moderate ban victim:<Member> reason:<Text> [proof:<Attachment>]: This command (/moderate ban) has an required option with the name "victim" that only accepts one member as a value, another required option with the name "reason" that accepts any text as an value and a not-required option with the name "proof" which allows one attachment as its value.
| Command | Description |
|---|---|
/guess-the-number create min:<Integer> max:<Integer> [number:<Integer>] | Start a new game in the current channel with the specified range. Optionally set the exact number to guess (otherwise random). |
/guess-the-number status | Show the status of the current game in this channel (number, range, guess count, owner). Only visible to the command user. |
/guess-the-number end | End the current game in this channel. |
Configuration
Configuration
In this configuration file, you can configure the game behavior and messages. Open it in your dashboard.
| Field | Description |
|---|---|
| Admin-Roles | Roles that are allowed to create and manage game sessions using the /guess-the-number command. |
| Start-Message | Message sent at the beginning of a new game round. |
| End-Message | Message sent when a game round ends and a winner is found. |
| React with Lower / Higher reactions | If enabled, the bot reacts with up/down arrows on wrong guesses to indicate whether the correct number is higher or lower. If disabled, wrong guesses receive a cross reaction. |
Gamechannel Mode
In this configuration file, you can enable and configure the automatic game channel. Open it in your dashboard.
| Field | Description |
|---|---|
| Enable Gamechannel mode? | If enabled, a dedicated game channel is used where new games start automatically. |
| Gamechannel | The text channel used for automatic games. |
| Minimum number | The lower bound for the random number range in automatic games. |
| Highest number | The upper bound for the random number range in automatic games. |
Troubleshooting
The /guess-the-number command says I need admin roles
- You need to add your roles to the "Admin-Roles" list in the configuration. Additionally, set up the command permissions in your Discord server settings.
The bot is not reacting to guesses
- Make sure there is an active game session in the channel. Use
/guess-the-number createto start one. - Ensure the bot has the "Add Reactions" permission in the channel.
The game channel mode is not starting games automatically
- Make sure "Enable Gamechannel mode?" is enabled and a valid channel is selected.
- Verify that the minimum number is less than the highest number.
Stored data
The following data is being stored about every game session:
- The channel ID where the game takes place
- The number to guess, and the min/max range
- The ID of the user who created the game (owner)
- The total number of guesses
- Whether the game has ended
- Metadata about the entry (date when created and last updated)
To remove all data stored by this module, purge the module database.
