A Kahoot bot that can automatically find and answer quiz questions. This bot is built with Node.js and uses the kahoot.js-latest
and discord.js
libraries.
To install this project, follow the steps below:
-
Clone the repository:
git clone https://github.com/dexkillerx/kahoot-answers.git cd kahoot-anwers
-
Install the dependencies:
npm install
-
Or download the package
npm install kahoot-answers
Before using the bot, make sure to configure the necessary information:
- Create a configuration file or adjust the parameters directly in the code to specify the
QuizID
,pinCode
, andbotUsername
.
You can use the Kahoot bot with the provided functions in the module. Here are some examples of how to use it:
const { Kahoot } = require('kahoot-answers');
// Create an instance of the Kahoot bot
const kahootBot = new Kahoot({
QuizID: 'your_quiz_id',
pinCode: 'your_pin_code',
botUsername: 'BotName'
});
To retrieve the answers from a quiz:
kahootBot.returnAnswers().then(answers => {
console.log(answers);
});
To join a Kahoot game and automatically answer the questions:
interaction = // interaction = discord interaction (slash commands)
kahootBot.joinGame('your_pin_code', 'BotName', interaction);
To join a Kahoot game and automatically answer the questions with a specified delay:
interaction = // interaction = discord interaction (slash commands)
kahootBot.joinGameWithTimeout('your_pin_code', 'BotName', interaction, { timeout: 5 });
- Join a Kahoot Game: The bot can join a game using the PIN code and a specified username.
- Retrieve Answers: The bot can extract the correct answers from a Kahoot quiz.
- Automatic Answering: The bot can automatically answer the quiz questions.
- Answer with Delay: The bot can automatically answer the quiz questions with a specified delay.