diff --git a/commands/textedit/zalgo.js b/commands/textedit/zalgo.js new file mode 100644 index 00000000..50cd98e9 --- /dev/null +++ b/commands/textedit/zalgo.js @@ -0,0 +1,26 @@ +const commando = require('discord.js-commando'); +const zalgo = require('zalgolize'); + +class ZalgoCommand extends commando.Command { + constructor(Client){ + super(Client, { + name: 'zalgo', + group: 'textedit', + memberName: 'zalgo', + description: 'Zalgoizes Text (;zalgo This Text)', + examples: [';zalgo This Text'] + }); + } + + async run(message, args) { + if(message.channel.type !== 'dm') { + if(!message.channel.permissionsFor(this.client.user).hasPermission('SEND_MESSAGES')) return; + if(!message.channel.permissionsFor(this.client.user).hasPermission('READ_MESSAGES')) return; + } + console.log("[Command] " + message.content); + let zalgoified = zalgo(message.content.split(" ").slice(1).join(" ")); + message.channel.sendMessage(zalgoified); + } +} + +module.exports = ZalgoCommand; \ No newline at end of file diff --git a/package.json b/package.json index a5e7ea0c..96edad94 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ "google-translate-api": "^2.2.2", "jimp": "^0.2.27", "pirate-speak": "^1.0.1", - "urban": "^0.3.1" + "urban": "^0.3.1", + "zalgolize": "^1.2.4" } }