diff --git a/src/modules/utility.js b/src/modules/utility.js index a81300a..8946e7d 100644 --- a/src/modules/utility.js +++ b/src/modules/utility.js @@ -292,7 +292,7 @@ lookupinvite.callback = async function (msg, line) { try { invite = await hf.bot.requestHandler.request( "GET", - `/invites/${line}?with_counts=1` + `/invites/${line}?with_counts=true&with_expiration=true` ); } catch (err) { bail = true; @@ -328,11 +328,38 @@ lookupinvite.callback = async function (msg, line) { value: `**${invite.channel.name}** (${invite.channel.id})`, inline: true, }, + { + name: "Boosts", + value: invite.guild.premium_subscription_count ?? 0, + inline: true, + }, + { + name: "Expires", + value: + invite.expires_at == null + ? "Never" + : ``, + inline: true, + }, { name: "Member Count", value: `${STATUS_ICONS.online}${invite.approximate_presence_count} online\t\t${STATUS_ICONS.offline}${invite.approximate_member_count} members`, inline: false, }, + invite.welcome_screen && { + name: "Welcome Screen", + value: `"${ + invite.welcome_screen.description + }"\n${invite.welcome_screen.welcome_channels.map( + (c) => + `${ + c.emoji_id + ? `[:${c.emoji_name}:](${EMOTE_BASE}${c.emoji_id}.webp)` + : c.emoji_name + } ${c.description} \`(${c.channel_id})\`` + )}`, + inline: false, + }, { name: "Features", value: @@ -348,7 +375,7 @@ lookupinvite.callback = async function (msg, line) { : "None", inline: false, }, - ], + ].filter((x) => !!x), thumbnail: { url: invite.guild.icon && @@ -761,9 +788,9 @@ presence.callback = async function (msg, line) { if (activity.emoji) { if (activity.emoji.id) { - const url = `https://cdn.discordapp.com/emojis/${ - activity.emoji.id - }.${activity.emoji.animated ? "gif" : "png"}`; + const url = `${EMOTE_BASE}${activity.emoji.id}.${ + activity.emoji.animated ? "gif" : "png" + }`; embed.author = { url, icon_url: url,