diff --git a/README.md b/README.md index b3f6feec..923aa10d 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ Xiao is a Discord bot coded in JavaScript with 6. Run `npm i -g pm2` to install PM2. 7. Run `pm2 start Xiao.js --name xiao` to run the bot. -## Commands (344) +## Commands (345) ### Utility: * **eval:** Executes JavaScript code. @@ -106,6 +106,7 @@ Xiao is a Discord bot coded in JavaScript with * **joke:** Responds with a random joke. * **karen:** Responds with a random image of Karen. * **kiss-marry-kill:** Determines who to kiss, who to marry, and who to kill. +* **light-novel-title:** Responds with a randomly generated Light Novel title. * **magic-conch:** Asks your question to the Magic Conch. * **meme:** Responds with a random meme. * **name:** Responds with a random name, with the gender of your choice. diff --git a/commands/random/light-novel-title.js b/commands/random/light-novel-title.js new file mode 100644 index 00000000..0d46f521 --- /dev/null +++ b/commands/random/light-novel-title.js @@ -0,0 +1,29 @@ +const Command = require('../../structures/Command'); +const request = require('node-superfetch'); + +module.exports = class LightNovelTitleCommand extends Command { + constructor(client) { + super(client, { + name: 'light-novel-title', + aliases: ['ln-title'], + group: 'random', + memberName: 'light-novel-title', + description: 'Responds with a randomly generated Light Novel title.', + credit: [ + { + name: 'LN title generator', + url: 'https://salty-salty-studios.com/shiz/ln.php' + } + ] + }); + } + + async run(msg) { + try { + const { text } = await request.get('https://salty-salty-studios.com/shiz/ln.php'); + return msg.say(text.match(/

(.+)<\/h1>/i)[1]); + } catch (err) { + return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`); + } + } +}; diff --git a/package.json b/package.json index 8a82c821..fe1b3cad 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiao", - "version": "107.3.1", + "version": "107.4.0", "description": "Your personal server companion.", "main": "Xiao.js", "scripts": {