discord.js-poll is a Node.js module that allows you to create polls with your discord bot. You can customize the separator (between the title and the options) and the color of the embed.
npm i discord.js-poll
poll(message: Discord.Message, args: string[], separator: string, embedColor: Discord.ColorResolvable)
const Discord = require('discord.js');
const { poll } = require('discord.js-poll');
module.exports = {
name: 'poll',
description: 'Create a poll',
usage: 'Title + Option 1 + Option 2 + Option 3 + etc',
execute(client, message, args) {
poll(message, args, '+', '#00D1CD');
},
};
!poll Is this a poll ?
This will return an embed message with 'Is this a poll ?' as title and with ๐ and ๐ reactions.
!poll What is your favorite food ? + Pasta + Burgers + Pizza
This will return an embed message with 'What is your favorite food ?' as title and 'Pasta', 'Burger' and 'Pizza' as fields, with corresponding reactions (๐ฆ => ๐จ).
(If '+' is chosed as separator)