Added null safety
This commit is contained in:
@@ -18,7 +18,6 @@ module.exports = {
|
||||
await interaction.deferReply({ ephemeral: true })
|
||||
|
||||
const embedColor = Number(color.replace("#", "0x"))
|
||||
|
||||
const footerText = interaction.guild ? interaction.guild.name : interaction.user.username + " | " + devMessage
|
||||
const footerIcon = interaction.guild ? interaction.guild.iconURL({ dynamic: true }) : interaction.user.avatarURL({ dynamic: true })
|
||||
|
||||
@@ -46,7 +45,7 @@ module.exports = {
|
||||
],
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: interaction?.guild.iconURL({ dynamic: true }) || null
|
||||
url: interaction?.guild?.iconURL({ dynamic: true }) || null
|
||||
},
|
||||
footer: {
|
||||
icon_url: footerIcon,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
const { SlashCommandBuilder } = require("discord.js")
|
||||
const { color, devMessage } = require("../../config/options.json")
|
||||
const { bwfkdr, bwstars, bwwins, swstars, duelswins, duelswlr } = require("../../config/reqs.json")
|
||||
const { bwfkdr, bwstars, bwwins, swstars, swkdr, duelswins, duelswlr } = require("../../config/reqs.json")
|
||||
|
||||
module.exports = {
|
||||
name: "reqs",
|
||||
@@ -26,7 +26,7 @@ module.exports = {
|
||||
description: "**You must make 100k-150k weekly GEXP.\nAs well as onne of the game stats below**",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: interaction.guild.iconURL()
|
||||
url: interaction?.guild?.iconURL({ dynamic: true }) || null
|
||||
},
|
||||
fields: [
|
||||
{
|
||||
@@ -37,7 +37,8 @@ module.exports = {
|
||||
},
|
||||
{
|
||||
name: "**Skywars**",
|
||||
value: "**Stars:** `" + swstars.toString() + "`"
|
||||
value: "**Stars:** `" + swstars.toString() +
|
||||
"`\n**KDR:** `" + swkdr.toString() + "`"
|
||||
},
|
||||
{
|
||||
name: "**Duels**",
|
||||
|
||||
Reference in New Issue
Block a user