GithubHelp home page GithubHelp logo

discord.js-poll's Introduction

discord.js-poll

npm NPM npm

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.

Installation

npm i discord.js-poll

Parameters type

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

Documentation

Discord.Message

Discord.ColorResolvable

Usage example

Code

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');
	},
};

On discord

!poll Is this a poll ?

This will return an embed message with 'Is this a poll ?' as title and with ๐Ÿ‘ and ๐Ÿ‘Ž reactions.

Simple Poll Image

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

Poll Image

โš ๏ธ You cannot add more than 26 options to the poll.

discord.js-poll's People

Contributors

nicolasmf avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

discord.js-poll's Issues

Not sending embedded messages

Noticed a problem in the index.js file which is responsible for the poll function...with the new version of discord.js and embedded message should and only can be sent like so:
message.channel.send({embeds: [embed]});
unlike before:
message.channel.send({ embed}) ;
So if you just implement that the poll function will be usable again.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.