Discord Emojiquiz is a powerful NodeJs module that allows you to easily create Emojiquizzes!
- Easy to use! π₯³
- Uses discord.js v14! β‘
- Supports all languages by configurating messages! π
- Supports MySQL database! π
- Uses SlashCommands! π
- Fast to setup! π¨βπ»
npm i discord-emojiquiz
If you need an example
you can go to: discord-emojiquiz-bot
const client = new Client({ intents: [GatewayIntentBits.Guilds, GatewayIntentBits.MessageContent, GatewayIntentBits.GuildMessages, GatewayIntentBits.GuildMessageReactions] });
const { Emojiquiz } = require('discord-emojiquiz');
const emojiquiz = new Emojiquiz();
emojiquiz.host = "localhost";
emojiquiz.user = "root";
emojiquiz.password = "";
emojiquiz.database = "jeezyDevelopment";
emojiquiz.charset = 'utf8mb4';
emojiquiz.bigNumbers = true;
module.exports = {emojiquiz};
- Require discord-emojiquiz
- Make a new instance of Emojiquiz
- Set DB details
- Export new instance variable (emojiquiz)
const { emojiquiz } = require('../db.js');
const { ActivityType } = require('discord.js');
module.exports = {
name: 'ready',
once: true,
execute(client) {
emojiquiz.ready();
console.log(`Ready! Logged in as ${client.user.tag}`);
}
};
- (!IMPORTANT!) Import variable from before into ready.js and do emojiquiz.ready();
const { SlashCommandBuilder } = require('discord.js');
const { emojiquiz } = require('../db');
module.exports = {
data: new SlashCommandBuilder()
.setName('emojiquiz-create')
.setDescription('Creates emojiquiz.')
.addStringOption(option =>
option.setName('emoji-word')
.setDescription('Enter the word in emojis.')
.setRequired(true))
.addStringOption(option =>
option.setName('emoji-hint')
.setDescription('Give a hint.')
.setRequired(true))
.addStringOption(option =>
option.setName('searched-word')
.setDescription('Enter the searched word.')
.setRequired(true)),
async execute(interaction) {
const emoji_word = await interaction.options.getString('emoji-word');
const emoji_hint = await interaction.options.getString('emoji-hint');
const searched_word = await interaction.options.getString('searched-word');
emojiquiz.interaction = interaction;
emojiquiz.word = emoji_word;
emojiquiz.hint = emoji_hint;
emojiquiz.searched_word = searched_word;
emojiquiz.createEmojiQuiz();
}
};
- Import emojiquiz again
- Set emojiquiz.word && emojiquiz.hint && emojiquiz.searched_word
- After that do emojiquiz.createEmojiQuiz();
const { SlashCommandBuilder } = require('discord.js');
const { emojiquiz } = require('../db.js');
module.exports = {
data: new SlashCommandBuilder()
.setName('emojiquiz-delete')
.setDescription('Finds and deletes emojiquiz out of the db.')
.addStringOption(option =>
option.setName('emoji')
.setDescription('Enter the emoji.')
.setRequired(true)),
async execute(interaction) {
const emojiquiz_delete = await interaction.options.getString('emoji');
emojiquiz.interaction = interaction;
emojiquiz.delete = emojiquiz_delete;
emojiquiz.deleteEmojiQuiz();
}
};
- Import emojiquiz again
- Set emojiquiz.interaction && emojiquiz.delete
- After that do emojiquiz.deleteEmojiQuiz();
const { SlashCommandBuilder } = require('discord.js');
const { emojiquiz } = require('../db.js');
module.exports = {
data: new SlashCommandBuilder()
.setName('emojiquiz-reset')
.setDescription('Resets the whole bot to 0.'),
async execute(interaction) {
emojiquiz.interaction = interaction;
emojiquiz.resetEmojiQuiz();
}
};
- Import emojiquiz again
- Set emojiquiz.interaction
- After that do emojiquiz.resetEmojiQuiz();
const { SlashCommandBuilder } = require('discord.js');
const { emojiquiz } = require('../db');
module.exports = {
data: new SlashCommandBuilder()
.setName('emojiquiz-setup')
.setDescription('Setups the emojiquiz')
.addChannelOption(option =>
option.setName('channel')
.setDescription('Select the channel where the emojiquiz should be sent to.')
.setRequired(true))
.addChannelOption(option =>
option.setName('pending_channel')
.setDescription('Select channel where new emojiquiz suggestion should be sent to.')
.setRequired(true)),
async execute(interaction) {
const emojiquiz_channel = await interaction.options.getChannel('channel');
const emojiquiz_pending = await interaction.options.getChannel('pending_channel');
emojiquiz.pending_channel = emojiquiz_pending;
emojiquiz.channel = emojiquiz_channel;
emojiquiz.interaction = interaction;
emojiquiz.setup();
}
};
- Set emojiquiz.interaction && emojiquiz.pending_channel && emojiquiz.channel
- After that do emojiquiz.setup();
const { emojiquiz } = require('../db.js');
module.exports = {
name: 'interactionCreate',
async execute(interaction) {
emojiquiz.button = interaction;
emojiquiz.skip();
emojiquiz.firstLetter();
emojiquiz.suggest_new_quiz();
}
};
- Set emojiquiz.button
- Set the buttons emojiquiz.skip(); && emojiquiz.firstLetter(); && emojiquiz.suggest_new_quiz();
const { emojiquiz } = require('../db.js');
const { emojiquizContent } = require('../utils/messages.js')
module.exports = {
name: 'messageCreate',
async execute(message) {
emojiquiz.message = message;
emojiquiz.start();
}
};
- Import emojiquiz again
- Do emojiquiz.start(); to start Emojiquiz
(!IMPORTANT!) Before we come to the configuration part you need to make sure that you require { emojiquizContent } in the file where you call the emojiquiz.start() methode.
const { emojiquizContent } = require('../utils/messages.js')
So when you done that we can start doing the message editing. π₯³
const { emojiquizContent } = require('../utils/messages.js')
let { message } = require('discord-emojiquiz');
message.emojiquizContent.color = '#FF8800';
message.emojiquizContent.title = 'Emojiquiz';
module.exports = {message};
- Require discord-emojiquiz again
- Set new messages with message.emojiquizContent
- Do console.log(message.emojiquizContent) to see everything you can change
I hope you have fun with this package and enjoy playing emojiquizzes. π€³π₯³π
If you still need support or want to join a community! π