From c77577a38251d8780b33ffd277adae295c601cb0 Mon Sep 17 00:00:00 2001 From: ChrisChrome Date: Tue, 18 Jun 2024 20:31:48 -0600 Subject: [PATCH] Fix outlook command --- index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index 2630aed..a7cab7f 100644 --- a/index.js +++ b/index.js @@ -91,7 +91,7 @@ const getUniqueChannels = function () { // Get first url in a string, return object {string, url} remove the url from the string const getFirstURL = function (string) { - const url = string.match(/(https?:\/\/[^\s]+)/g); + url = string.match(/(https?:\/\/[^\s]+)/g); if (!url) return { string, url: null }; const newString = string.replace(url[0], ""); return { string: newString, url: url[0] }; @@ -1071,7 +1071,7 @@ discord.on("interactionCreate", async (interaction) => { // Get the callsign const callsign = interaction.options.getString("callsign"); // Get the URL associated with the callsign - const url = nwrstreams.callsigns[callsign]; + url = nwrstreams.callsigns[callsign]; // Get the voice channel channel = interaction.member.voice?.channel; // Use a unique variable name @@ -1287,7 +1287,7 @@ discord.on("interactionCreate", async (interaction) => { case Discord.InteractionType.MessageComponent: if (interaction.customId) { const product_id = interaction.customId; - const url = `https://mesonet.agron.iastate.edu/api/1/nwstext/${product_id}`; + url = `https://mesonet.agron.iastate.edu/api/1/nwstext/${product_id}`; await interaction.deferReply({ ephemeral: true }); fetch(url).then((res) => { if (res.status !== 200) {