mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-09 14:43:05 -04:00
fix errors for guilds with no icon
This commit is contained in:
parent
615fd4bc82
commit
27bc88ea15
3 changed files with 14 additions and 7 deletions
|
@ -31,12 +31,15 @@ module.exports = {
|
|||
// Guild Card
|
||||
let guildCard = createEmbed("default", context, {
|
||||
description: `${icon("house")} **${g.name}** ${highlight(`(${g.id})`)}\n\n${icon("calendar")} **Created at: **${timestamp(g.createdAt, "f")}`,
|
||||
thumbnail: {
|
||||
url: g.iconUrl + `?size=4096`
|
||||
},
|
||||
fields: []
|
||||
})
|
||||
|
||||
if(g.iconUrl){
|
||||
inviteCard.thumbnail = {
|
||||
url: g.iconUrl + `?size=4096`
|
||||
}
|
||||
}
|
||||
|
||||
if(g.owner) guildCard.description += `\n\n<:lc_guild_owner:674652779406426122> **Server Owner: **<@${g.owner.id}>`
|
||||
|
||||
// Channel Container
|
||||
|
|
|
@ -13,7 +13,8 @@ module.exports = {
|
|||
},
|
||||
run: async (context) => {
|
||||
context.triggerTyping();
|
||||
editOrReply(context, {
|
||||
if(!context.guild.iconUrl) return editOrReply(context, createEmbed("warning", context, "Server doesn't have an icon."))
|
||||
return editOrReply(context, {
|
||||
embeds: [createEmbed("default", context, {
|
||||
image: {
|
||||
url: context.guild.iconUrl + "?size=4096"
|
||||
|
|
|
@ -32,12 +32,15 @@ module.exports = {
|
|||
// Guild Card
|
||||
let inviteCard = createEmbed("default", context, {
|
||||
description: `${icon("link")} **https://discord.gg/${inviteCode[1]}**\n\n${icon("house")} **${g.name}** ${highlight(`(${g.id})`)}\n${icon("calendar")} **Created at: **${timestamp(g.createdAt, "f")}\n\n${icon("people")}${highlight(invite.approximateMemberCount.toLocaleString())} ${icon("online")}${highlight(invite.approximatePresenceCount.toLocaleString())} ${icon("offline")}${highlight((invite.approximateMemberCount - invite.approximatePresenceCount).toLocaleString())}`,
|
||||
thumbnail: {
|
||||
url: g.iconUrl + `?size=4096`
|
||||
},
|
||||
fields: []
|
||||
})
|
||||
|
||||
if(g.iconUrl){
|
||||
inviteCard.thumbnail = {
|
||||
url: g.iconUrl + `?size=4096`
|
||||
}
|
||||
}
|
||||
|
||||
// Guild Features
|
||||
if(g.features.length >= 1){
|
||||
let featureCards = guildFeaturesField(g)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue