Greatest Of the Year bot!
- 2 Devlogs
- 2 Total hours
G.O.Y. bot anwsers philosophical questions , helps you make decisons with coinflip, and it also teaches random facts if you ask him nicely.
G.O.Y. bot anwsers philosophical questions , helps you make decisons with coinflip, and it also teaches random facts if you ask him nicely.
Fix API Base URL from https://jsph.pl to https://uselessfacts.jsph.pl/api/v2/facts/random?language=en
Purpose: Returns a random answer to the question of
the meaning of life.
How it works: The command uses Math.random() and
Math.floor() to randomly select one response from a fixed array of possible
answers.
Purpose: (self explanatory) Fetches random facts
How it works: The command fetches data from the
external API. It sends the Accept: application/json header and checks
apiResponse.ok to make sure the request was successful before processing the
JSON response.
Purpose: a simple heads or tails result directly in
the execution channel.
How it works: The command uses an array containing
two possible results, [“Heads”, “Tails”], and randomly
selects one of them using a mathematical array index.