add basics for stock quotes
This commit is contained in:
parent
72c35fa864
commit
ac8f3d0b26
24
commands/stonk.js
Normal file
24
commands/stonk.js
Normal 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);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
@ -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}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user