From a8aebe683cddd632e1695ade50ec67f158218480 Mon Sep 17 00:00:00 2001 From: MoSiren Date: Tue, 18 Jun 2024 06:45:51 +0000 Subject: [PATCH] Error With Chris PFP not showing up when not in the discord server. --- index.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/index.js b/index.js index a6191a5..328db2f 100644 --- a/index.js +++ b/index.js @@ -895,7 +895,7 @@ discord.on("interactionCreate", async (interaction) => { const embed = { title: "About Me!", thumbnail: { - url: discord.user.avatarURL() + url: discord.user?.avatarURL() }, description: `I listen to all the weather.im rooms and send them to discord channels.\nI am open source, you can find my code [here!](https://github.com/ChrisChrome/iembot-2.0)\n\nThis bot is not affiliated with NOAA, the National Weather Service, or the IEM project.`, fields: [ @@ -926,7 +926,7 @@ discord.on("interactionCreate", async (interaction) => { color: 0x00ff00, footer: { text: "Made by @chrischrome with <3", - icon_url: discord.users.cache.get("289884287765839882").avatarURL() + icon_url: "https://cdn.discordapp.com/avatars/289884287765839882/2b00063a92adfe08f325353eee29e348.webp?size=1024&format=webp&width=0&height=5" } } interaction.reply({ embeds: [embed] }); @@ -1206,9 +1206,9 @@ discord.on("interactionCreate", async (interaction) => { }); break; case "alertmap": - url = "https://forecast.weather.gov/wwamap/png/US.png" + const alertmapurl = "https://forecast.weather.gov/wwamap/png/US.png" await interaction.deferReply(); - fetch(url).then((res) => { + fetch(alertmapurl).then((res) => { if (res.status !== 200) { interaction.editReply({ content: "Failed to get alert map", ephemeral: true }); return; @@ -1218,7 +1218,7 @@ discord.on("interactionCreate", async (interaction) => { embeds: [{ title: `Alert Map`, image: { - url: `attachment://alerts.png` + alertmapurl: `attachment://alerts.png` }, color: 0x00ff00 }],