dont leak alphavantage key!!

main
suhas 2 years ago
parent 6461b9ca79
commit 93f765b88c

@ -12,7 +12,7 @@ export default class StockCommand extends SlashCommand {
async run(ctx: CommandContext) {
const tkr = ctx.options.ticker
const req = await fetch(`https://www.alphavantage.co/query?function=GLOBAL_QUOTE&symbol=${tkr}&apikey=8O1INVBY11E0GRGC`)
const req = await fetch(`https://www.alphavantage.co/query?function=GLOBAL_QUOTE&symbol=${tkr}&apikey=${process.env.ALPHAVANTAGE_KEY}`)
const info = await req.json()
if (Object.keys(info['Global Quote']).length == 0) {
return `stock not found!`

Loading…
Cancel
Save