GithubHelp home page GithubHelp logo

discord-votemaster's People

Contributors

iansan5653 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

discord-votemaster's Issues

Fatal error thrown when required parameters are not passsed to commands

ISSUE: the command !results #0 or !vote #0 is failing to catch some bad input. Input by a user it throws a unexpected error and crashes the script when a user sends a command !results without the #

index.js:367
            } else if(args[0].charAt(0) !== '#') {
                              ^
TypeError: Cannot read property 'charAt' of undefined

and

events.js:180
    throw err; // Unhandled 'error' event
    ^

FIX:
where
if(args[0].charAt(0) !== '#') {

should be

if(!args[0] || args[0].charAt(0) !== '#') {

Add option to list users that voted to !results

Hi, I noticed you had strikethrough text describing a feature to list the users that voted. Is this feature something planned and not yet made? Or a feature that was made and Discord changed their permissions to no longer make this possible?

Another Fatal error thrown when required parameters are not passsed to commands

Hey Ian,
found another one just for your information.
when user inputs a command!vote #0 without the following args[1] will result in another fatal crash.
so I included || !args[1] to the if statement to catch.
look forward to see your latest edition. Eventually I will add some more features and fork this baby and ensure credit is due for the wonderful poll system you coded.
best,
Just

ISSUE:

if(activePollsInServer.length === 0) {
				voteResponse = `There aren't any active polls in this server right now, so you can't vote.`;

-                                } else if(!args[0] || args[0].charAt(0) !== '#') {
				// Only the vote was supplied
				if(activePollsInServer.length === 1) {
					voteResponse = polls.get(activePollsInServer[0]).vote(args[0].toLowerCase(), message.author).message;
				} else {
					// TODO dynamic examples
					voteResponse = 'Sorry, I don\'t know which poll to vote on. Please specify the poll id number using a pound sign and a number (ie \'!vote #1 A\') before your vote.';
				}

FIXED:

if(activePollsInServer.length === 0) {
				voteResponse = `There aren't any active polls in this server right now, so you can't vote.`;

			} else if(!args[0] || args[0].charAt(0) !== '#' || !args[1]) {
				// Only the vote was supplied
				if(activePollsInServer.length === 1) {
					voteResponse = polls.get(activePollsInServer[0]).vote(args[0].toLowerCase(), message.author).message;
				} else {
					// TODO dynamic examples
					voteResponse = 'Sorry, I don\'t know which poll to vote on. Please specify the poll id number using a pound sign and a number (ie \'!vote #1 A\') before your vote.';
				}

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.