add basics for stock quotes

This commit is contained in:
= 2021-07-13 21:55:14 -04:00
parent 72c35fa864
commit ac8f3d0b26
2 changed files with 31 additions and 0 deletions

24
commands/stonk.js Normal file
View File

@ -0,0 +1,24 @@
var axios = require("axios").default;
var options = {
method: 'GET',
url: 'https://yahoo-finance-low-latency.p.rapidapi.com/v6/finance/quote',
params: {symbols: ''},
headers: {
'x-rapidapi-key': '0b3f85bcb7msh1e6e80e963c9914p1d1934jsnc3542fc83520',
'x-rapidapi-host': 'yahoo-finance-low-latency.p.rapidapi.com'
}
};
module.exports = {
name: 'stonk',
description: 'Get stonk details from Yahoo Finance',
execute(message, file) {
options.params.symbols = file.name;
axios.request(options).then(function (response) {
}).catch(function (error) {
console.error(error);
});
}
}

View File

@ -97,5 +97,12 @@ module.exports = {
.setDescription(data.content) .setDescription(data.content)
.setTimestamp() .setTimestamp()
.setFooter(`@${author.username}#${author.discriminator}`); .setFooter(`@${author.username}#${author.discriminator}`);
},
createStockEmbed(data, author, command) {
return new Discord.MessageEmbed()
.setAuthor(command)
.setTitle()
.setTimestamp()
.setFooter(`@${author.username}#${author.discriminator}`);
} }
} }