Permalink
Browse files

Add the `!randomonium` command.

  • Loading branch information...
roncli committed Jun 30, 2016
1 parent 900181b commit 01a484ec8001e482677a872c18777a931c48cf2b
Showing with 52 additions and 0 deletions.
  1. +5 −0 README.md
  2. +47 −0 sixgaming.js
View
@@ -89,6 +89,11 @@ The following should be the contents of settings.js:
Version History
===============
1.1.1 - 6/29/2016
-----------------
* Adds the `!randomonium` command.
1.1 - 6/19/2016
---------------
View
@@ -21,6 +21,29 @@ var pjson = require("./package.json"),
"itunes",
"discord"
],
owHeroes = [
"Genji",
"McCree",
"Pharah",
"Reaper",
"Soldier: 76",
"Tracer",
"Bastion",
"Hanzo",
"Junkrat",
"Mei",
"Torbjörn",
"Widowmaker",
"D.Va",
"Reinhardt",
"Roadhog",
"Winston",
"Zarya",
"Lúcio",
"Mercy",
"Symmetra",
"Zenyatta"
],
lastHost = 0,
wasEmptyLast = false,
commandRotationWait = 5,
@@ -1155,6 +1178,30 @@ SixGaming.discordMessages = {
}
},
randomonium: function(from, user, message) {
var index;
if (!user.voiceChannel) {
SixGaming.discordQueue("Sorry, " + user + ", but you must be in a voice channel to use this command.");
return;
}
owHeroes.sort(function() {
return Math.random() - 0.5;
});
for (index in user.voiceChannel.members) {
if (user.voiceChannel.members.hasOwnProperty(index)) {
SixGaming.discordQueue(user.voiceChannel.members[index] + ": " + owHeroes[index]);
if (message === "dupe" || message === "dupes") {
owHeroes.sort(function() {
return Math.random() - 0.5;
});
}
}
}
},
help: function(from, user, message) {
if (!message) {
SixGaming.discordQueue(user + ", see the documentation in " + sixDiscord.channels.get("name", "six-gaming-info") + ".");

0 comments on commit 01a484e

Please sign in to comment.