forked from ChrisChrome/weather-bot
Error With Chris PFP not showing up when not in the discord server.
This commit is contained in:
parent
249788ae8c
commit
a8aebe683c
10
index.js
10
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
|
||||
}],
|
||||
|
|
Loading…
Reference in a new issue