Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

discord.js-akinator

Package Overview
Dependencies
Maintainers
1
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

discord.js-akinator

A Discord.js v14 module that allows you to create an Akinator command for your discord bot in a matter of seconds.

  • 4.0.6
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
221
decreased by-14.67%
Maintainers
1
Weekly downloads
 
Created
Source

🔮 Discord.js Akinator 🔮

A Discord.js v14 module that allows you to create an Akinator command for your discord bot in a matter of seconds.

NPM

Downloads Discord Server

Buy Me A Coffee

Features

  • 🌎 100+ Languages Supported! | Lightning fast translation has been made possible by Google Translate and hard-coded mappings!

  • ▶️ Buttons! | Don't want to type out responses to questions? This package gives you the option to use discord's buttons to easily click your answer of choice!

  • 🎮 Multiple Game Types! | This package will allow you to choose whether Akinator will guess an animal, character or object!

  • 🙋 Child Mode! | Want to filter out NSFW questions? You can choose to enable Akinator's Child Mode to keep your games squeaky clean!

  • ⚡️ Quick & Easy Setup! | This package was built with the intentions of working out-of-the-box. Only one parameter is required at least!

  • 🤖 Slash Command & Message Support! | No matter how your bot receives its commands, you can simply pass in a CommandInteraction or Message and it will work!

Installation & Compatibility List

To install this package, simply run the following command in your terminal:

npm i discord.js-akinator --save

Please Note: The latest release of this package is only compatible with Discord.js v14. If you are using Discord.js v13 or v12, please refer to the table below to find the version that suits your needs.

Discord.js VersionRecommended Package Version
v14.x.xv4.x.x (@latest)
v13.x.xv3.x.x (@3.4.5)
v12.x.xv2.1.0 or earlier

Code Examples

Initial Setup:

const { Client, IntentsBitField } = require("discord.js");
const akinator = require("discord.js-akinator");
const client = new Client({
    intents: [
        IntentsBitField.Flags.Guilds,
        IntentsBitField.Flags.GuildMessages,
        IntentsBitField.Flags.MessageContent
    ]
});

client.login("Discord Bot Token");

client.on("ready", () => {
    console.log("Bot is Online");
});

// Example options for Discord.js Akinator:

const language = "en"; // The Language of the Game
const childMode = false; // Whether to use Akinator's Child Mode
const gameType = "character"; // The Type of Akinator Game to Play. ("animal", "character" or "object")
const useButtons = true; // Whether to use Discord's Buttons
const embedColor = "#1F1E33"; // The Color of the Message Embeds

With Discord.js Akinator, you can choose whether you want to use a message, or a slash command as the input. Here's a quick example on how to do both!

Using Discord's Slash Commands as Input:

client.on("interactionCreate", async interaction => {
    if (!interaction.isChatInputCommand()) return; // If the interaction is not a slash command, do nothing
    if (interaction.commandName === "akinator") { // If the user sends "/akinator"...
        akinator(interaction, {
            language: language, // Defaults to "en"
            childMode: childMode, // Defaults to "false"
            gameType: gameType, // Defaults to "character"
            useButtons: useButtons, // Defaults to "false"
            embedColor: embedColor // Defaults to "Random"
        });
    };
});

Using a Message as Input:

// ATTENTION: Make sure to enable the "Message Content" intent for your bot in the Discord Developer Portal!

const PREFIX = "!"; // Your bot's command prefix

client.on("messageCreate", async message => {
    if (message.content.startsWith(`${PREFIX}akinator`)) { // When the user types "!akinator"...
        akinator(message, {
            language: language, // Defaults to "en"
            childMode: childMode, // Defaults to "false"
            gameType: gameType, // Defaults to "character"
            useButtons: useButtons, // Defaults to "false"
            embedColor: embedColor // Defaults to "Random"
        });
    };
});

Contributors

Contact Us


Created and maintained by Diamond Digital Development Logo

Keywords

FAQs

Package last updated on 14 May 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc