|
|
|
@ -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!`
|
|
|
|
|