class guessThePokemonGame
Generates random images with different pokemons. Allows unlimited attempts.
Constructor
new guessThePokemonGame(options)
Parameters
options
(Object)base
(Object): Required. EitherInteraction
orMessage
.baseType
(String): Required. Must be either "interaction" or "message".embed
(Object): Optional. Configuration for the embed message.title
(String): Title for the embed. Default set to "Guess The Pokemon Game".color
(String): Default set to "#2BFFE6".winMessage
(String): Default set to "You're right! The Pokemon is ${pokemonName}!".loseMessage
(String): Default set to "You're wrong! Please Try Again.".timeoutMessage
(String): Message when the player doesn't respond in time. Default set to `"You didn't respond in time. The Pokemon is ${pokemonName}!"``.
button
(Object): Optional. Configuration for the input button to open a Modal.text
(String): Default set to "Input Answer".style
(Number): Style of the button. Default is set toPrimary
.emoji
(String): Emoji for the button. Default's set to null.
time
(String|Number): Optional. Inactivity time. Can be a string (e.g., "30 seconds") or a number (milliseconds). Default is set to 30000 (30 seconds).
Methods
- StartGame(): starts the game.
Example
Javascript
import { guessThePokemonGame } from "shockbs";
new guessThePokemonGame({
base: interaction,
baseType: "Interaction"
embed: {
title: "Who's the Pokemon?",
color: "#F600FF",
winMessage: "You're right! The Pokemon is ${pokemonName}.",
loseMessage: "You're wrong! Please try again.",
timeoutMessage: "You didn't respond in time. The pokemon was ${pokemonName}."
},
button: {
text: "Input Answer",
style: ButtonStyle.Primary,
emoji: null,
},
time: "half minute",
}).startGame();