Added basic poll functionality

This commit is contained in:
plane000
2018-05-21 21:55:33 +01:00
parent 427db61faf
commit 0867cc0dba
4 changed files with 114 additions and 10 deletions

View File

@@ -4,7 +4,7 @@ const fs = require('fs');
const Logger = require('./logger');
const Config = require('./config');
const Commands = require('./commands/commands')
const RuleCommands = require('./commands/rulecommands')
const MultiServerCommands = require('./commands/multiservercommands')
const AdminCommands = require('./commands/admincommands')
const CommandManager = require('./main');
@@ -30,17 +30,21 @@ module.exports.loadCommands = function() {
addCommand('Help', 'help', undefined, 'help [command] or [help]', 'Returns a usage chart for the command requested, or returns a link to a command list', false, Commands.help);
addCommand('Say', 'say', undefined, 'say [input]', 'Repeats the input', false, Commands.say);
addCommand('Version', 'version', undefined, 'version', 'Returns the version', false, Commands.version);
addCommand('Ping', 'ping', undefined, 'ping', 'Returns round trip to discords servers', false, Commands.ping);
addCommand('Ping', 'ping', undefined, 'ping', 'Returns round trip time to discords servers', false, Commands.ping);
addCommand('Cat', 'cat', undefined, 'cat', 'Returns a picture of a cat', false, Commands.cat);
addCommand('Dog', 'dog', undefined, 'dog', 'Returns a picture of a dog', false, Commands.dog);
addCommand('Undo', 'undo', undefined, 'undo', 'Deletes last message sent by Jeffery from the channel the command was issued in', false, Commands.undo);
//rule commands
addCommand('Rules', 'rules', undefined, 'rules', 'Returns all the rules for the server the command was issued on', false, RuleCommands.rules);
addCommand('Rule', 'rule', undefined, 'rule [rule number]', 'Returns corresponding rule for the server the command was issued on', false, RuleCommands.rule);
addCommand('AddRule', 'addrule', undefined, 'addrule [new rule]', 'Adds a rule to the rule list for the server the command was issued on', true, RuleCommands.addrule);
addCommand('DelRule', 'delrule', undefined, 'delrule [rule number]', 'Deletes the corresponding rule for the server the command was issued on', true, RuleCommands.delrule);
addCommand('EditRule', 'editrule', undefined, 'editrule [rule number] [new rule]', 'Edits the corresponding rule for the server the command was issued on', true, RuleCommands.editrule);
addCommand('Rules', 'rules', undefined, 'rules', 'Returns all the rules for the server the command was issued on', false, MultiServerCommands.rules);
addCommand('Rule', 'rule', undefined, 'rule [rule number]', 'Returns corresponding rule for the server the command was issued on', false, MultiServerCommands.rule);
addCommand('Add Rule', 'addrule', undefined, 'addrule [new rule]', 'Adds a rule to the rule list for the server the command was issued on', true, MultiServerCommands.addrule);
addCommand('Delete Rule', 'delrule', undefined, 'delrule [rule number]', 'Deletes the corresponding rule for the server the command was issued on', true, MultiServerCommands.delrule);
addCommand('EditRule', 'editrule', undefined, 'editrule [rule number] [new rule]', 'Edits the corresponding rule for the server the command was issued on', true, MultiServerCommands.editrule);
//vote commands
addCommand('Poll', 'poll', undefined, 'poll start [option1/option2...] or poll stop', 'Starts/stops an automated poll with the options given as a third argument to \'poll start\' and are seperated with a \'/\' with no spaces', false, MultiServerCommands.poll);
addCommand('Vote', 'vote', undefined, 'vote [option]', 'Places your vote on the option you chose, based on the running poll in the server the \'poll start\' command was issued in', false, MultiServerCommands.vote);
//admin commands
addCommand('Shutdown', 'stop', undefined, 'stop', 'Shutsdown JefferyBot', true, AdminCommands.stop);