diff --git a/commands/exit.js b/commands/exit.js new file mode 100644 index 0000000..0a0a793 --- /dev/null +++ b/commands/exit.js @@ -0,0 +1,12 @@ +var libFlayer = require("../libFlayer.js"); + +module.exports = { + name: 'exit', + description: 'Exit', + execute(message) { + message.reply( + `!Goodbye world - someone respawn my process` + ); + await new Promise(resolve => setTimeout(process.exit(), 5000)); + } +}; \ No newline at end of file diff --git a/commands/help.js b/commands/help.js index 415701d..e994ab5 100644 --- a/commands/help.js +++ b/commands/help.js @@ -4,10 +4,15 @@ module.exports = { name: 'help', description: 'Help', execute(message) { - message.reply('!help - Lists the available commands'); - message.reply('**!search** - Searches the RSS Sources: *!search google*'); - message.reply('**!get**- Retrieves Search By Index: *!get 25*'); - message.reply('**!add** - Add a new RSS Source Feed dynamically: *!add http://www.engadget.com/rss.xml*'); - message.reply('**!update** - Updates all current RSS Feeds: *!update*'); + message.reply( + `!help - Lists the available commands + **!search** - Searches the RSS Sources: *!search google* + **!get**- Retrieves Search By Index: *!get 25* + **!add** - Add a new RSS Source Feed dynamically: *!add http://www.engadget.com/rss.xml* + **!update** - Updates all current RSS Feeds: *!update* + **!quote** - Selects a random quote: *!update* + **!exit** - Force kills bot: *!exit* + ` + ); } }; \ No newline at end of file diff --git a/commands/quotes.js b/commands/quotes.js new file mode 100644 index 0000000..8668727 --- /dev/null +++ b/commands/quotes.js @@ -0,0 +1,12 @@ + +var libFlayer = require("../libFlayer.js"); +module.exports = { + name: 'quote', + description: 'Quote!', + execute(message) { + var quotes = libFlayer.getQuotes(); + var selectedQuote = Math.floor(Math.random() * quotes.length); + message.reply(quotes[selectedQuote]); + + } +}; \ No newline at end of file diff --git a/index.js b/index.js index f72bd91..f3c6717 100644 --- a/index.js +++ b/index.js @@ -1,5 +1,6 @@ const fs = require('fs'); const { prefix, token } = require('./config.json'); +const { quotes } = require('./quotes.json'); const Discord = require('discord.js'); const client = new Discord.Client(); client.commands = new Discord.Collection(); diff --git a/libFlayer.js b/libFlayer.js index 4cdff1f..9a91e51 100644 --- a/libFlayer.js +++ b/libFlayer.js @@ -5,6 +5,8 @@ let feeds = require('./feeds.json'); let linkFlayerMap = []; +const { quotes } = require('./quotes.json'); + exports.addSource = function(title,source){ var linkData = { title: `${title}`, @@ -45,4 +47,8 @@ exports.getFeeds = function () { exports.getSources = function () { return feeds; +} + +exports.getQuotes = function () { + return quotes; } \ No newline at end of file diff --git a/quotes.json b/quotes.json new file mode 100644 index 0000000..425c77a --- /dev/null +++ b/quotes.json @@ -0,0 +1,14 @@ +{ + "quotes": [ + "You're Breathtaking - Keanu Reeves", + "I cannot be caged. I cannot be controlled. Undersand this as you die, ever pathetic ever fools", + "It's dangerous to go alone! Take this.", + "I'm not crying, you're crying", + "A Code Must Be Determined By The Individual... This Is What I've Decided. - Sekiro", + "Every thought is a seed.", + "Experience is the name everyone gives to their mistakes.", + " In order to be irreplaceable, one must always be different” – Coco Chanel", + "The Measure Of An Individual Can Be Difficult To Discern By Actions Alone." + ] + +} \ No newline at end of file