Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
discord.js-akinator
Advanced tools
A Discord.js v14 module that allows you to create an Akinator command for your discord bot in a matter of seconds.
🌎 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!
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.
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. Defaults to "en".
const childMode = false; //Whether to use Akinator's Child Mode. Defaults to "false".
const gameType = "character"; //The type of Akinator game to be played. ("animal", "character" or "object"). Defaults to "character".
const useButtons = true; //Whether to use Discord's buttons instead of message input for answering questions. Defaults to "true".
const embedColor = "#1F1E33"; //The color of the message embeds. Defaults to "Random".
const translationCachingOptions = {
enabled: true, //Whether to cache translations. Defaults to "true". (Recommended)
path: "./translationCache" //The path to the translation cache folder relative to the current working directory. Defaults to "./translationCache".
};
With Discord.js Akinator, you can choose whether you want to use a slash command, or a message as the input. Here's some quick examples on how to do both!
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,
childMode: childMode,
gameType: gameType,
useButtons: useButtons,
embedColor: embedColor,
translationCaching: translationCachingOptions
});
};
});
//IMPORTANT: 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,
childMode: childMode,
gameType: gameType,
useButtons: useButtons,
embedColor: embedColor,
translationCaching: translationCachingOptions
});
};
});
Special thanks to many people helping to make language translation more accurate, refactor code, provide compatibility for new Discord.js versions, and so much more!
👋 Need help? Join our Discord Server!
👾 Found a bug, or inaccurate translations? Open an issue, or fork and submit a pull request on our GitHub repository!
FAQs
A Discord.js v14 module that allows you to create an Akinator command for your discord bot in a matter of seconds.
The npm package discord.js-akinator receives a total of 187 weekly downloads. As such, discord.js-akinator popularity was classified as not popular.
We found that discord.js-akinator demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.