Skip to content

cgolden15/discord.js-qotd

Repository files navigation

npm npm NPM

discord.js-qotd is a Node.js module that allows you to create polls or questions of the day with your discord bot. You can customize the arg separator, emoji and the embed color!


Note: Currently the FLAGS.GUILD_MESSAGES intent is required.

This will be updated shortly by using slash commands. If you wish to contribute to this update, open a pull request.

What's next:

  • Slash command support instead of traditional message command.
  • Buttons instead of reactions
  • Variable message content to go along with the qotd embed.

Installation


npm i discord.js-qotd

Parameter types


poll(message: Discord.Message, args: string[], separator: string, embedColor: Discord.ColorResolvable, emoji: string)

Documentation

Discord.Message

Discord.ColorResolvable


Usage example

Code

const Discord = require('discord.js');
const { poll } = require('discord.js-qotd');

module.exports = {
	name: 'qotd',
	description: 'Create a qeustion of the day embed.',
	usage: 'Title + Option 1 + Option 2 + Option 3 + etc',
	execute(client, message, args) {
		poll(message, args, '+', '#00D1CD', "🤷‍♂️");
	},
};

On discord

!qotd Is this a poll?

This will return an embed message with 'Is this a poll?' as title and with 👍 and 👎 reactions.

image


!poll message + args1 + args2 + args3

This will return an embed message with 'message' as title and 'args1', 'args2' and 'args3' as fields, with corresponding reactions (🇦 => 🇨).

(If '+' is chosed as separator and '🤷‍♂️' as the emoji)


image

⚠️ You cannot add more than 26 options to the poll.


Disclaimer: This module was originally created by nicolasmf under the name discord.js-poll. The original code for this plugin was taken from there in accordance with its MIT license. I took on this project due to lack of updates, functionality and v13 support from nicholasmf.

Hits