forked from ChrisChrome/weather-bot
await my beloved
This commit is contained in:
parent
62f9f4af19
commit
21e96e8d52
2
index.js
2
index.js
|
@ -616,7 +616,7 @@ discord.on("interactionCreate", async (interaction) => {
|
||||||
if (interaction.customId) {
|
if (interaction.customId) {
|
||||||
const product_id = interaction.customId;
|
const product_id = interaction.customId;
|
||||||
const url = `https://mesonet.agron.iastate.edu/api/1/nwstext/${product_id}`;
|
const url = `https://mesonet.agron.iastate.edu/api/1/nwstext/${product_id}`;
|
||||||
interaction.deferReply({ ephemeral: true });
|
await interaction.deferReply({ ephemeral: true });
|
||||||
fetch(url).then((res) => {
|
fetch(url).then((res) => {
|
||||||
if (res.status !== 200) {
|
if (res.status !== 200) {
|
||||||
interaction.reply({ content: "Failed to get product text", ephemeral: true });
|
interaction.reply({ content: "Failed to get product text", ephemeral: true });
|
||||||
|
|
Loading…
Reference in a new issue