diff --git a/README.md b/README.md index 2cf8f6db..1d75dabc 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 (339) +## Commands (340) ### Utility: * **eval:** Executes JavaScript code. @@ -125,6 +125,7 @@ Xiao is a Discord bot coded in JavaScript with ### Single Response: +* **can-you-not:** Can YOU not? * **dark-light:** Determines whether you use dark or light theme. * **eat-pant:** Eat pant. * **eggs-get-laid:** Sends the ultimate roast. diff --git a/commands/events/apod.js b/commands/events/apod.js index 89d24534..f4b03a82 100644 --- a/commands/events/apod.js +++ b/commands/events/apod.js @@ -32,7 +32,7 @@ module.exports = class ApodCommand extends Command { ) .setImage(body.media_type === 'image' ? body.url : null) .setURL(body.url) - .setFooter(`Image Credits: ${body.copyright || 'Public Domain'}`) + .setFooter(`Image Credits: ${body.copyright ? body.copyright.replace(/\n/g, '/') : 'Public Domain'}`) .setTimestamp(); return msg.embed(embed); } catch (err) { diff --git a/commands/random/random-user.js b/commands/random/random-user.js index f17ffcb0..8ae1e1dc 100644 --- a/commands/random/random-user.js +++ b/commands/random/random-user.js @@ -7,12 +7,15 @@ module.exports = class RandomUserCommand extends Command { aliases: ['member-roulette', 'user-roulette', 'random-member'], group: 'random', memberName: 'random-user', - description: 'Randomly chooses a member of the server.', - guildOnly: true + description: 'Randomly chooses a member of the server.' }); } run(msg) { + if (msg.channel.type === 'dm') { + const members = [this.client.user, msg.channel.recipient]; + return msg.say(`I choose ${members[Math.floor(Math.random() * members.length)].username}!`); + } return msg.say(`I choose ${msg.guild.members.random().displayName}!`); } }; diff --git a/commands/search/nasa.js b/commands/search/nasa.js index 3476b1b9..d850c81a 100644 --- a/commands/search/nasa.js +++ b/commands/search/nasa.js @@ -1,5 +1,6 @@ const Command = require('../../structures/Command'); const request = require('node-superfetch'); +const { MessageEmbed } = require('discord.js'); const { shorten } = require('../../util/Util'); module.exports = class NASACommand extends Command { @@ -9,7 +10,7 @@ module.exports = class NASACommand extends Command { group: 'search', memberName: 'nasa', description: 'Searches NASA\'s image archive for your query.', - clientPermissions: ['ATTACH_FILES'], + clientPermissions: ['EMBED_LINKS'], args: [ { key: 'query', @@ -31,7 +32,16 @@ module.exports = class NASACommand extends Command { const images = body.collection.items; if (!images.length) return msg.say('Could not find any results.'); const data = images[Math.floor(Math.random() * images.length)]; - return msg.say(shorten(data.data[0].description), { files: [data.links[0].href] }); + const embed = new MessageEmbed() + .setTitle(data.data[0].title) + .setDescription(shorten(data.data[0].description)) + .setColor(0x2E528E) + .setAuthor('NASA', 'https://i.imgur.com/Wh8jY9c.png', 'https://www.nasa.gov/multimedia/imagegallery/index.html') + .setImage(data.links[0].href) + .setURL(data.links[0].href) + .setFooter(`Image Credits: ${data.data[0].center || 'Public Domain'}`) + .setTimestamp(new Date(data.data[0].date_created)); + return msg.embed(embed); } catch (err) { return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`); } diff --git a/commands/single/can-you-not.js b/commands/single/can-you-not.js new file mode 100644 index 00000000..79c50341 --- /dev/null +++ b/commands/single/can-you-not.js @@ -0,0 +1,18 @@ +const Command = require('../../structures/Command'); + +module.exports = class CanYouNotCommand extends Command { + constructor(client) { + super(client, { + name: 'can-you-not', + aliases: ['can-u-not'], + group: 'single', + memberName: 'can-you-not', + description: 'Can YOU not?', + patterns: [/can (you|u) not/i] + }); + } + + run(msg) { + return msg.reply('Can YOU not?'); + } +}; diff --git a/commands/util/info.js b/commands/util/info.js index b0dc7a9a..1c26e743 100644 --- a/commands/util/info.js +++ b/commands/util/info.js @@ -11,7 +11,7 @@ module.exports = class InfoCommand extends Command { constructor(client) { super(client, { name: 'info', - aliases: ['stats'], + aliases: ['stats', 'uptime'], group: 'util', memberName: 'info', description: 'Responds with detailed bot information.', diff --git a/package.json b/package.json index dfcddab8..7b19dd25 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiao", - "version": "101.8.0", + "version": "101.9.0", "description": "Your personal server companion.", "main": "Xiao.js", "scripts": {