Clean this up a bit

This commit is contained in:
Daniel Odendahl Jr
2017-09-29 20:12:19 +00:00
parent 943e763638
commit 4cfa18c757
+2 -8
View File
@@ -27,14 +27,8 @@ module.exports = class ZalgoCommand extends Command {
let result = '';
for (let i = 0; i < text.length; i++) {
result += text[i];
const counts = {
up: Math.floor(Math.random() * 8) + 1,
middle: Math.floor(Math.random() * 3),
down: Math.floor(Math.random() * 8) + 1
};
for (const type of Object.keys(counts)) {
let count = counts[type];
const chars = zalgo[type];
for (const chars of Object.values(zalgo)) {
let count = Math.floor(Math.random() * 5);
while (count--) result += chars[Math.floor(Math.random() * chars.length)];
}
}