From e7fde647693a3539f1e8126e04a7c5174fc12ee5 Mon Sep 17 00:00:00 2001 From: Daniel Odendahl Jr Date: Tue, 22 Aug 2017 23:03:56 +0000 Subject: [PATCH] RSGTMNSERJGNERSLJGNERLG --- commands/random/stocks.js | 56 --------------------------------------- package.json | 2 +- 2 files changed, 1 insertion(+), 57 deletions(-) delete mode 100644 commands/random/stocks.js diff --git a/commands/random/stocks.js b/commands/random/stocks.js deleted file mode 100644 index 5900336a..00000000 --- a/commands/random/stocks.js +++ /dev/null @@ -1,56 +0,0 @@ -const Command = require('../../structures/Command'); -const { MessageEmbed } = require('discord.js'); -const snekfetch = require('snekfetch'); -const moment = require('moment'); -const { ALPHA_VANTAGE_KEY } = process.env; - -module.exports = class StocksCommand extends Command { - constructor(client) { - super(client, { - name: 'stocks', - aliases: ['stock'], - group: 'random', - memberName: 'stocks', - description: 'Responds with the stock information for the symbol you specify.', - clientPermissions: ['EMBED_LINKS'], - args: [ - { - key: 'symbol', - prompt: 'What is the symbol you would like to get data for?', - type: 'string' - } - ] - }); - } - - async run(msg, args) { - const { symbol } = args; - const { body } = await snekfetch - .get('https://www.alphavantage.co/query') - .query({ - function: 'TIME_SERIES_INTRADAY', - symbol, - interval: '1min', - apikey: ALPHA_VANTAGE_KEY - }); - if (body['Error Message']) return msg.say('Invalid Symbol.'); - const data = body['Time Series (1min)'][Object.keys(body['Time Series (1min)'])[0]]; - const embed = new MessageEmbed() - .setColor(0x0D0D0D) - .setTitle(symbol.toUpperCase()) - .setTimestamp() - .addField('❯ Open', - `$${parseFloat(data['1. open'])}`, true) - .addField('❯ Close', - `$${parseFloat(data['4. close'])}`, true) - .addField('❯ Volume', - data['5. volume'], true) - .addField('❯ High', - `$${parseFloat(data['2. high'])}`, true) - .addField('❯ Low', - `$${parseFloat(data['3. low'])}`, true) - .addField('❯ Last Updated', - moment(Object.keys(body['Time Series (1min)'])[0]).format('MM-DD-YYYY hh:mm'), true); - return msg.embed(embed); - } -}; diff --git a/package.json b/package.json index c8a24718..22ce93a3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiaobot", - "version": "31.1.0", + "version": "31.0.2", "description": "Your personal server companion.", "main": "Shard.js", "scripts": {