diff --git a/README.md b/README.md index d9a167de..af4a912f 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ Xiao is a Discord bot coded in JavaScript with 7. Run `npm i -g pm2` to install PM2. 8. Run `pm2 start Xiao.js --name xiao` to run the bot. -## Commands (336) +## Commands (337) ### Utility: * **eval:** Executes JavaScript code. @@ -68,6 +68,7 @@ Xiao is a Discord bot coded in JavaScript with * **emoji:** Responds with detailed information on an emoji. * **first-message:** Responds with the first message ever sent to a channel. * **id:** Responds with a user's ID. +* **message-source:** Responds with a codeblock containing a message's contents. * **message:** Responds with detailed information on a message. * **role:** Responds with detailed information on a role. * **server:** Responds with detailed information on the server. diff --git a/commands/info/message-source.js b/commands/info/message-source.js new file mode 100644 index 00000000..7f1dbd3b --- /dev/null +++ b/commands/info/message-source.js @@ -0,0 +1,25 @@ +const Command = require('../../structures/Command'); +const { shorten } = require('../../util/Util'); + +module.exports = class MessageSourceCommand extends Command { + constructor(client) { + super(client, { + name: 'message-source', + aliases: ['msg-source', 'message-src', 'msg-src'], + group: 'info', + memberName: 'message-source', + description: 'Responds with a codeblock containing a message\'s contents.', + args: [ + { + key: 'message', + prompt: 'Which message do you want to get the source of?', + type: 'message' + } + ] + }); + } + + run(msg, { message }) { + return msg.code(null, shorten(message.content, 1990)); + } +}; diff --git a/package.json b/package.json index a71e09c7..a14380df 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiao", - "version": "101.5.0", + "version": "101.6.0", "description": "Your personal server companion.", "main": "Xiao.js", "scripts": {