diff --git a/README.md b/README.md index bacca71d..284043bd 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ the [home server](https://discord.gg/sbMe32W). 6. Run `npm i -g pm2` to install PM2. 7. Run `pm2 start Xiao.js --name xiao` to run the bot. -## Commands (329) +## Commands (333) ### Utility: * **eval:** Executes JavaScript code. @@ -68,6 +68,7 @@ the [home server](https://discord.gg/sbMe32W). * **emoji-image:** Responds with an emoji's full-scale image. * **emoji-list:** Responds with a list of the server's custom emoji. * **emoji-info:** 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-info:** Responds with detailed information on a message. * **role-info:** Responds with detailed information on a role. @@ -136,9 +137,12 @@ the [home server](https://discord.gg/sbMe32W). * **its-joke:** It's joke! * **just-do-it:** Sends a link to the "Just Do It!" motivational speech. * **lenny:** Responds with the lenny face. +* **nom:** Posts a GIF of Kanna eating a crab. +* **source:** Hello! Can you give me the source? * **spam:** Responds with a picture of Spam. * **tableflip:** Flips a table... With animation! * **wynaut:** Why not? Wynaut? +* **yoff:** Posts a picture that truly defines modern art. ### Events: diff --git a/assets/images/nom.gif b/assets/images/nom.gif new file mode 100644 index 00000000..ef290315 Binary files /dev/null and b/assets/images/nom.gif differ diff --git a/assets/images/source.png b/assets/images/source.png new file mode 100644 index 00000000..ed8a8a69 Binary files /dev/null and b/assets/images/source.png differ diff --git a/assets/images/yoff.png b/assets/images/yoff.png new file mode 100644 index 00000000..dcb35924 Binary files /dev/null and b/assets/images/yoff.png differ diff --git a/commands/info/first-message.js b/commands/info/first-message.js new file mode 100644 index 00000000..63dbf149 --- /dev/null +++ b/commands/info/first-message.js @@ -0,0 +1,38 @@ +const Command = require('../../structures/Command'); +const { MessageEmbed } = require('discord.js'); + +module.exports = class FirstMessageCommand extends Command { + constructor(client) { + super(client, { + name: 'first-message', + aliases: ['first-msg'], + group: 'info', + memberName: 'first-message', + description: 'Responds with the first message ever sent to a channel.', + clientPermissions: ['EMBED_LINKS'], + args: [ + { + key: 'channel', + prompt: 'Which channel would you like to get the first message of?', + type: 'channel', + default: msg => msg.channel + } + ] + }); + } + + async run(msg, { channel }) { + const messages = await channel.messages.fetch({ after: 1, limit: 1 }); + const message = messages.first(); + const format = message.author.avatar && message.author.avatar.startsWith('a_') ? 'gif' : 'png'; + const embed = new MessageEmbed() + .setColor(message.member ? message.member.displayHexColor : 0x00AE86) + .setThumbnail(message.author.displayAvatarURL({ format })) + .setAuthor(msg.author.tag, msg.author.displayAvatarURL({ format })) + .setDescription(message.content) + .setTimestamp(message.createdAt) + .setFooter(`ID: ${message.id}`) + .addField('❯ Jump', message.url); + return msg.embed(embed); + } +}; diff --git a/commands/info/message.js b/commands/info/message.js index 03c62737..e3ac6d12 100644 --- a/commands/info/message.js +++ b/commands/info/message.js @@ -25,7 +25,7 @@ module.exports = class MessageInfoCommand extends Command { const embed = new MessageEmbed() .setColor(message.member ? message.member.displayHexColor : 0x00AE86) .setThumbnail(message.author.displayAvatarURL({ format })) - .setAuthor(msg.author.tag, msg.author.displayAvatarURL({ format })) + .setAuthor(message.author.tag, message.author.displayAvatarURL({ format })) .setDescription(message.content) .setTimestamp(message.createdAt) .setFooter(`ID: ${message.id}`) diff --git a/commands/single/nom.js b/commands/single/nom.js new file mode 100644 index 00000000..0a6ef42a --- /dev/null +++ b/commands/single/nom.js @@ -0,0 +1,19 @@ +const Command = require('../../structures/Command'); +const path = require('path'); + +module.exports = class NomCommand extends Command { + constructor(client) { + super(client, { + name: 'nom', + aliases: ['kanna-crab'], + group: 'single', + memberName: 'nom', + description: 'Posts a GIF of Kanna eating a crab.', + clientPermissions: ['ATTACH_FILES'] + }); + } + + run(msg) { + return msg.say({ files: [path.join(__dirname, '..', '..', 'assets', 'images', 'nom.gif')] }); + } +}; diff --git a/commands/single/source.js b/commands/single/source.js new file mode 100644 index 00000000..5727558a --- /dev/null +++ b/commands/single/source.js @@ -0,0 +1,19 @@ +const Command = require('../../structures/Command'); +const path = require('path'); + +module.exports = class SourceCommand extends Command { + constructor(client) { + super(client, { + name: 'source', + aliases: ['sauce'], + group: 'single', + memberName: 'source', + description: 'Hello! Can you give me the source?', + clientPermissions: ['ATTACH_FILES'] + }); + } + + run(msg) { + return msg.say({ files: [path.join(__dirname, '..', '..', 'assets', 'images', 'source.png')] }); + } +}; diff --git a/commands/single/yoff.js b/commands/single/yoff.js new file mode 100644 index 00000000..ef133ddf --- /dev/null +++ b/commands/single/yoff.js @@ -0,0 +1,18 @@ +const Command = require('../../structures/Command'); +const path = require('path'); + +module.exports = class SourceCommand extends Command { + constructor(client) { + super(client, { + name: 'yoff', + group: 'single', + memberName: 'yoff', + description: 'Posts a picture that truly defines modern art.', + clientPermissions: ['ATTACH_FILES'] + }); + } + + run(msg) { + return msg.say({ files: [path.join(__dirname, '..', '..', 'assets', 'images', 'yoff.png')] }); + } +}; diff --git a/package.json b/package.json index 089dec53..70acaf46 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiao", - "version": "96.1.1", + "version": "96.2.0", "description": "Your personal server companion.", "main": "Xiao.js", "scripts": {