Skip to content

Complete framework to facilitate the creation of emojiquizzes using discord.js! πŸ₯³πŸ€³πŸ‘€

License

Notifications You must be signed in to change notification settings

JeffreyTheCreator/discord-emojiquiz

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

30 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Discord-Emojiquiz

DISCONTINUED

CLOSE THE SQL INJECTIONS IF YOU WANT TO USE THIS PROJECT


Discord Emojiquiz is a powerful NodeJs module that allows you to easily create Emojiquizzes!

Features

  • Easy to use! πŸ₯³
  • Uses discord.js v14! ⚑
  • Supports all languages by configurating messages! πŸ› 
  • Supports MySQL database! πŸ”
  • Uses SlashCommands! 😎
  • Fast to setup! πŸ‘¨β€πŸ’»

Installation OUTDATED

npm i discord-emojiquiz

Examples / Images

If you need an example you can go to: discord-emojiquiz-bot

Required Discord Intents


const client = new Client({ intents: [GatewayIntentBits.Guilds, GatewayIntentBits.MessageContent, GatewayIntentBits.GuildMessages, GatewayIntentBits.GuildMessageReactions] });

Database

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)

Ready event

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();

CreateEmojiQuiz

  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();

DeleteEmojiQuiz

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();

ResetEmojiQuiz

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();

Setup

  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();

Set Emojiquiz buttons

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();

Start

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

Configurate messages

(!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

That's it!

I hope you have fun with this package and enjoy playing emojiquizzes. 🀳πŸ₯³πŸ˜Ž

If you still need support or want to join a community! πŸ‘‡

About

Complete framework to facilitate the creation of emojiquizzes using discord.js! πŸ₯³πŸ€³πŸ‘€

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published