Zalgo myself, guys woot

This commit is contained in:
Daniel Odendahl Jr
2017-09-29 14:37:51 +00:00
parent 086b0c9414
commit deff3c901b
3 changed files with 140 additions and 6 deletions
+120
View File
@@ -0,0 +1,120 @@
{
"up": [
"̍",
"̎",
"̄",
"̅",
"̿",
"̑",
"̆",
"̐",
"͒",
"͗",
"͑",
"̇",
"̈",
"̊",
"͂",
"̓",
"̈",
"͊",
"͋",
"͌",
"̃",
"̂",
"̌",
"͐",
"̀",
"́",
"̋",
"̏",
"̒",
"̓",
"̔",
"̽",
"̉",
"ͣ",
"ͤ",
"ͥ",
"ͦ",
"ͧ",
"ͨ",
"ͩ",
"ͪ",
"ͫ",
"ͬ",
"ͭ",
"ͮ",
"ͯ",
"̾",
"͛",
"͆",
"̚"
],
"middle": [
"̕",
"̛",
"̀",
"́",
"͘",
"̡",
"̢",
"̧",
"̨",
"̴",
"̵",
"̶",
"͜",
"͝",
"͞",
"͟",
"͠",
"͢",
"̸",
"̷",
"͡",
"҉"
],
"down": [
"̖",
"̗",
"̘",
"̙",
"̜",
"̝",
"̞",
"̟",
"̠",
"̤",
"̥",
"̦",
"̩",
"̪",
"̫",
"̬",
"̭",
"̮",
"̯",
"̰",
"̱",
"̲",
"̳",
"̹",
"̺",
"̻",
"̼",
"ͅ",
"͇",
"͈",
"͉",
"͍",
"͎",
"͓",
"͔",
"͕",
"͖",
"͙",
"͚",
"̣"
]
}
+17 -2
View File
@@ -1,5 +1,5 @@
const { Command } = require('discord.js-commando');
const zalgo = require('zalgolize');
const zalgo = require('../../assets/json/zalgo');
module.exports = class ZalgoCommand extends Command {
constructor(client) {
@@ -24,6 +24,21 @@ module.exports = class ZalgoCommand extends Command {
}
run(msg, { text }) {
return msg.say(zalgo(text));
let result = '';
for (let i = 0; i < text.length; i++) {
result += text[i];
if (text[i].length > 1) continue;
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)) {
const count = counts[type];
const chars = zalgo[type];
while (count--) result += chars[Math.floor(Math.random() * chars.length)];
}
}
return msg.say(result);
}
};
+3 -4
View File
@@ -1,6 +1,6 @@
{
"name": "xiaobot",
"version": "42.15.3",
"version": "42.15.4",
"description": "Your personal server companion.",
"main": "Shard.js",
"scripts": {
@@ -39,13 +39,12 @@
"erlpack": "github:discordapp/erlpack",
"mathjs": "^3.16.3",
"node-opus": "^0.2.7",
"pg": "^6.4.2",
"pg": "^7.3.0",
"pg-hstore": "^2.3.2",
"sequelize": "^4.11.5",
"snekfetch": "^3.4.1",
"uws": "^8.14.1",
"xml-js": "^1.4.2",
"zalgolize": "^1.2.4"
"xml-js": "^1.4.2"
},
"devDependencies": {
"eslint": "^4.7.2",