From a430c15bd75f9faef289d4e3c77eb1aa41313d74 Mon Sep 17 00:00:00 2001 From: Daniel Odendahl Jr Date: Tue, 2 Oct 2018 00:34:06 +0000 Subject: [PATCH] Sha1 Command --- README.md | 3 ++- commands/text-edit/sha-1.js | 25 +++++++++++++++++++++++++ package.json | 2 +- 3 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 commands/text-edit/sha-1.js diff --git a/README.md b/README.md index 39b41fc2..009eaf52 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Xiao is a Discord bot coded in JavaScript with The bot is no longer available for invite. You can self-host the bot, or use her on the [home server](https://discord.gg/sbMe32W). -## Commands (321) +## Commands (322) ### Utility: * **eval:** Executes JavaScript code. @@ -328,6 +328,7 @@ on the [home server](https://discord.gg/sbMe32W). * **repeat:** Repeat text over and over and over and over (etc). * **reverse:** Reverses text. * **say:** Make me say what you want, master. +* **sha-1:** Creates a hash of text with the SHA-1 algorithm. * **sha-256:** Creates a hash of text with the SHA-256 algorithm. * **ship-name:** Creates a ship name from two names. * **shorten-url:** Creates a goo.gl short URL from another URL. diff --git a/commands/text-edit/sha-1.js b/commands/text-edit/sha-1.js new file mode 100644 index 00000000..052f3ece --- /dev/null +++ b/commands/text-edit/sha-1.js @@ -0,0 +1,25 @@ +const Command = require('../../structures/Command'); +const { hash } = require('../../util/Util'); + +module.exports = class SHA1Command extends Command { + constructor(client) { + super(client, { + name: 'sha-1', + aliases: ['sha-1-hash'], + group: 'text-edit', + memberName: 'sha-1', + description: 'Creates a hash of text with the SHA-1 algorithm.', + args: [ + { + key: 'text', + prompt: 'What text would you like to create an SHA-1 hash of?', + type: 'string' + } + ] + }); + } + + run(msg, { text }) { + return msg.say(hash(text, 'sha1')); + } +}; diff --git a/package.json b/package.json index 08d5b39e..c4fe351f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiao", - "version": "92.0.0", + "version": "92.1.0", "description": "Your personal server companion.", "main": "Xiao.js", "scripts": {