From 0c6b44a8bec34495bccc8f87b60122dc1c5e9c99 Mon Sep 17 00:00:00 2001 From: Daniel Odendahl Jr Date: Wed, 6 Dec 2017 13:45:39 +0000 Subject: [PATCH] MD5 --- commands/text-edit/md5.js | 25 +++++++++++++++++++++++++ package.json | 2 +- 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 commands/text-edit/md5.js diff --git a/commands/text-edit/md5.js b/commands/text-edit/md5.js new file mode 100644 index 00000000..2001b77b --- /dev/null +++ b/commands/text-edit/md5.js @@ -0,0 +1,25 @@ +const { Command } = require('discord.js-commando'); +const crypto = require('crypto'); + +module.exports = class MD5Command extends Command { + constructor(client) { + super(client, { + name: 'md5', + aliases: ['md5-hash'], + group: 'text-edit', + memberName: 'md5', + description: 'Creates a hash of text with the MD5 algorithm.', + args: [ + { + key: 'text', + prompt: 'What text would you like to create an MD5 hash of?', + type: 'string' + } + ] + }); + } + + run(msg, { text }) { + return msg.say(crypto.createHash('md5').update(text).digest('hex')); + } +}; diff --git a/package.json b/package.json index 28b5890e..2bb8f901 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiaobot", - "version": "56.1.0", + "version": "56.2.0", "description": "Your personal server companion.", "main": "XiaoBot.js", "scripts": {