shorten more feature names, add feature formatter in other places

This commit is contained in:
Cynthia Foxwell 2025-04-18 11:27:26 -06:00
parent f119de0308
commit cba1c78aab
Signed by: Cynosphere
SSH key fingerprint: SHA256:H3SM8ufP/uxqLwKSH7xY89TDnbR9uOHzjLoBr0tlajk
3 changed files with 176 additions and 66 deletions

View file

@ -481,17 +481,37 @@ guildinfo.callback = async function (msg, line, args, {nolocal, debug}) {
const features = formatGuildFeatures(guild.features);
embed.fields.push({
name: `Features (${features.length})`,
value: features.length > 0 ? features.slice(0, Math.ceil(features.length / 2)).join("\n") : "None",
inline: true,
});
if (features.length > 1)
embed.fields.push({
name: "\u200b",
value: features.slice(Math.ceil(features.length / 2), features.length).join("\n"),
inline: true,
});
if (features.length > 0) {
let featuresList = "";
let firstFeature = true;
for (let index = 0; index < features.length; index++) {
const feature = features[index];
if (featuresList.length + feature.length + 1 > 1024) {
embed.fields.push({
name: firstFeature ? `Features (${features.length})` : "\u200b",
value: featuresList.trim(),
inline: true,
});
featuresList = feature + "\n";
if (firstFeature === true) firstFeature = false;
if (index === features.length - 1)
embed.fields.push({
name: firstFeature ? `Features (${features.length})` : "\u200b",
value: featuresList.trim(),
inline: true,
});
} else if (index === features.length - 1) {
featuresList = feature + "\n";
embed.fields.push({
name: firstFeature ? `Features (${features.length})` : "\u200b",
value: featuresList.trim(),
inline: true,
});
} else {
featuresList += feature + "\n";
}
}
}
const images = [];
if (guild.icon) {
@ -577,17 +597,37 @@ guildinfo.callback = async function (msg, line, args, {nolocal, debug}) {
if (invite?.guild?.features) {
const features = formatGuildFeatures(invite.guild.features);
embed.fields.push({
name: `Features (${features.length})`,
value: features.length > 0 ? features.slice(0, Math.ceil(features.length / 2)).join("\n") : "None",
inline: true,
});
if (features.length > 1)
embed.fields.push({
name: "\u200b",
value: features.slice(Math.ceil(features.length / 2), features.length).join("\n"),
inline: true,
});
if (features.length > 0) {
let featuresList = "";
let firstFeature = true;
for (let index = 0; index < features.length; index++) {
const feature = features[index];
if (featuresList.length + feature.length + 1 > 1024) {
embed.fields.push({
name: firstFeature ? `Features (${features.length})` : "\u200b",
value: featuresList.trim(),
inline: true,
});
featuresList = feature + "\n";
if (firstFeature === true) firstFeature = false;
if (index === features.length - 1)
embed.fields.push({
name: firstFeature ? `Features (${features.length})` : "\u200b",
value: featuresList.trim(),
inline: true,
});
} else if (index === features.length - 1) {
featuresList = feature + "\n";
embed.fields.push({
name: firstFeature ? `Features (${features.length})` : "\u200b",
value: featuresList.trim(),
inline: true,
});
} else {
featuresList += feature + "\n";
}
}
}
}
const images = [];
@ -657,17 +697,37 @@ guildinfo.callback = async function (msg, line, args, {nolocal, debug}) {
const features = formatGuildFeatures(invite.guild.features);
embed.fields.push({
name: `Features (${features.length})`,
value: features.length > 0 ? features.slice(0, Math.ceil(features.length / 2)).join("\n") : "None",
inline: true,
});
if (features.length > 1)
embed.fields.push({
name: "\u200b",
value: features.slice(Math.ceil(features.length / 2), features.length).join("\n"),
inline: true,
});
if (features.length > 0) {
let featuresList = "";
let firstFeature = true;
for (let index = 0; index < features.length; index++) {
const feature = features[index];
if (featuresList.length + feature.length + 1 > 1024) {
embed.fields.push({
name: firstFeature ? `Features (${features.length})` : "\u200b",
value: featuresList.trim(),
inline: true,
});
featuresList = feature + "\n";
if (firstFeature === true) firstFeature = false;
if (index === features.length - 1)
embed.fields.push({
name: firstFeature ? `Features (${features.length})` : "\u200b",
value: featuresList.trim(),
inline: true,
});
} else if (index === features.length - 1) {
featuresList = feature + "\n";
embed.fields.push({
name: firstFeature ? `Features (${features.length})` : "\u200b",
value: featuresList.trim(),
inline: true,
});
} else {
featuresList += feature + "\n";
}
}
}
const images = [];
if (invite.guild.icon) {

View file

@ -121,17 +121,36 @@ lookupinvite.callback = async function (msg, line) {
if (invite.guild.features) {
const features = formatGuildFeatures(invite.guild.features);
embed.fields.push({
name: `Features (${features.length})`,
value: features.length > 0 ? features.slice(0, Math.ceil(features.length / 2)).join("\n") : "None",
inline: true,
});
if (features.length > 1) {
embed.fields.push({
name: "\u200b",
value: features.slice(Math.ceil(features.length / 2), features.length).join("\n"),
inline: true,
});
if (features.length > 0) {
let featuresList = "";
let firstFeature = true;
for (let index = 0; index < features.length; index++) {
const feature = features[index];
if (featuresList.length + feature.length + 1 > 1024) {
embed.fields.push({
name: firstFeature ? `Features (${features.length})` : "\u200b",
value: featuresList.trim(),
inline: true,
});
featuresList = feature + "\n";
if (firstFeature === true) firstFeature = false;
if (index === features.length - 1)
embed.fields.push({
name: firstFeature ? `Features (${features.length})` : "\u200b",
value: featuresList.trim(),
inline: true,
});
} else if (index === features.length - 1) {
featuresList = feature + "\n";
embed.fields.push({
name: firstFeature ? `Features (${features.length})` : "\u200b",
value: featuresList.trim(),
inline: true,
});
} else {
featuresList += feature + "\n";
}
}
}
}

View file

@ -82,8 +82,14 @@ module.exports.GuildFeaturesFormatted = {
icon: SILK_ICONS.joystick,
name: "Activities (Internal Dev)",
},
ACTIVITY_FEED_ENABLED_BY_USER: {icon: SILK_ICONS.controller},
ACTIVITY_FEED_DISABLED_BY_USER: {icon: SILK_ICONS.controller_delete},
ACTIVITY_FEED_ENABLED_BY_USER: {
icon: SILK_ICONS.controller,
name: "Activity Feed: User Enabled",
},
ACTIVITY_FEED_DISABLED_BY_USER: {
icon: SILK_ICONS.controller_delete,
name: "Activity Feed: User Disabled",
},
ANIMATED_BANNER: {icon: SILK_ICONS.film},
ANIMATED_ICON: {icon: SILK_ICONS.film},
APPLICATION_COMMAND_PERMISSIONS_V2: {
@ -176,7 +182,10 @@ module.exports.GuildFeaturesFormatted = {
name: "Community: Large - Ungated",
},
COMMUNITY_EXP_MEDIUM: {icon: SILK_ICONS.group, name: "Community: Medium"},
CREATOR_ACCEPTED_NEW_TERMS: {icon: SILK_ICONS.check_checked_green},
CREATOR_ACCEPTED_NEW_TERMS: {
icon: SILK_ICONS.check_checked_green,
name: "Monetization: New Terms",
},
CREATOR_MONETIZABLE: {icon: SILK_ICONS.money, name: "Monetization"},
CREATOR_MONETIZABLE_DISABLED: {
icon: SILK_ICONS.money_delete,
@ -184,7 +193,7 @@ module.exports.GuildFeaturesFormatted = {
},
CREATOR_MONETIZABLE_PENDING_NEW_OWNER_ONBOARDING: {
icon: SILK_ICONS.money,
name: "Monetization: Pending Onboarding",
name: "Monetization: Pending New Owner",
},
CREATOR_MONETIZABLE_PROVISIONAL: {
icon: SILK_ICONS.money,
@ -202,7 +211,10 @@ module.exports.GuildFeaturesFormatted = {
icon: SILK_ICONS.money,
name: "Monetization Allow List",
},
CREATOR_STORE_PAGE: {icon: SILK_ICONS.basket},
CREATOR_STORE_PAGE: {
icon: SILK_ICONS.basket,
name: "Monetization: Store Page",
},
DEVELOPER_SUPPORT_SERVER: {icon: SILK_ICONS.cog},
DISCOVERABLE: {icon: SILK_ICONS.world},
DISCOVERABLE_DISABLED: {icon: SILK_ICONS.world_delete},
@ -211,7 +223,10 @@ module.exports.GuildFeaturesFormatted = {
icon: SILK_ICONS.shield,
name: "Non-Community Members Tab",
},
ENHANCED_ROLE_COLORS: {icon: SILK_ICONS.color_wheel, name: "Gradient Role Colors"},
ENHANCED_ROLE_COLORS: {
icon: SILK_ICONS.color_wheel,
name: "Gradient Roles",
},
EXPOSED_TO_ACTIVITIES_WTP_EXPERIMENT: {
icon: SILK_ICONS.bug,
name: "Activities: WTP Experiment",
@ -241,7 +256,10 @@ module.exports.GuildFeaturesFormatted = {
},
GUILD_HOME_OVERRIDE: {icon: SILK_ICONS.house, name: "Home Tab (Override)"},
GUILD_HOME_TEST: {icon: SILK_ICONS.bug, name: "Home Tab (Testing)"},
GUILD_MEMBER_VERIFICATION_EXPERIMENT: {icon: SILK_ICONS.bug},
GUILD_MEMBER_VERIFICATION_EXPERIMENT: {
icon: SILK_ICONS.bug,
name: "Member Verification Experiment",
},
GUILD_ONBOARDING: {
icon: SILK_ICONS.application_view_tile,
name: "Onboarding",
@ -266,29 +284,29 @@ module.exports.GuildFeaturesFormatted = {
},
GUILD_ROLE_SUBSCRIPTIONS: {
icon: SILK_ICONS.creditcards,
name: "Role Subscriptions",
name: "Subscriptions",
deprecated: true,
},
GUILD_ROLE_SUBSCRIPTION_PURCHASE_FEEDBACK_LOOP: {
icon: SILK_ICONS.creditcards,
name: "Role Subscriptions: Feedback Loop",
name: "Subscriptions: Feedback Loop",
deprecated: true,
},
GUILD_ROLE_SUBSCRIPTION_TIER_TEMPLATE: {
icon: SILK_ICONS.creditcards,
name: "Role Subscriptions: Tier Template",
name: "Subscriptions: Tier Template",
deprecated: true,
},
GUILD_ROLE_SUBSCRIPTION_TRIALS: {
icon: SILK_ICONS.creditcards,
name: "Role Subscriptions: Trials",
name: "Subscriptions: Trials",
deprecated: true,
},
GUILD_SERVER_GUIDE: {icon: SILK_ICONS.compass, name: "Server Guide"},
GUILD_TAGS: {icon: SILK_ICONS.tag_blue},
GUILD_WEB_PAGE_VANITY_URL: {
icon: SILK_ICONS.page_link,
name: "Guild Web Page Vanity URL",
name: "Vanity URL: Web Page",
},
HAD_EARLY_ACTIVITIES_ACCESS: {
icon: SILK_ICONS.joystick,
@ -314,8 +332,8 @@ module.exports.GuildFeaturesFormatted = {
LINKED_TO_HUB: {icon: SILK_ICONS.chart_organisation, name: "Student Hub: Linked to Hub"},
LURKABLE: {icon: SILK_ICONS.eye, deprecated: true},
MARKETPLACES_CONNECTION_ROLES: {icon: SILK_ICONS.link, deprecated: true},
MAX_FILE_SIZE_50_MB: {icon: SILK_ICONS.page_white_get, name: "Max File Size 50MB"},
MAX_FILE_SIZE_100_MB: {icon: SILK_ICONS.page_white_get, name: "Max File Size 100MB"},
MAX_FILE_SIZE_50_MB: {icon: SILK_ICONS.page_white_get, name: "Max File Size: 50MB"},
MAX_FILE_SIZE_100_MB: {icon: SILK_ICONS.page_white_get, name: "Max File Size: 100MB"},
MEDIA_CHANNEL_ALPHA: {icon: SILK_ICONS.photo, deprecated: true},
MEMBER_LIST_DISABLED: {icon: SILK_ICONS.delete, deprecated: true},
MEMBER_PROFILES: {icon: SILK_ICONS.vcard, deprecated: true},
@ -334,7 +352,7 @@ module.exports.GuildFeaturesFormatted = {
},
MOBILE_WEB_ROLE_SUBSCRIPTION_PURCHASE_PAGE: {
icon: SILK_ICONS.creditcards,
name: "Role Subscriptions: Mobile Page",
name: "Subscriptions: Mobile Page",
deprecated: true,
},
MONETIZATION_ENABLED: {icon: SILK_ICONS.money, deprecated: true},
@ -358,7 +376,7 @@ module.exports.GuildFeaturesFormatted = {
},
PRODUCTS_AVAILABLE_FOR_PURCHASE: {
icon: SILK_ICONS.basket,
name: "Products: Has Purchasable",
name: "Products: Purchasable",
},
PUBLIC: {icon: SILK_ICONS.world, deprecated: true},
PUBLIC_DISABLED: {icon: SILK_ICONS.world_delete, deprecated: true},
@ -371,12 +389,15 @@ module.exports.GuildFeaturesFormatted = {
ROLE_ICONS: {icon: SILK_ICONS.tag_blue},
ROLE_SUBSCRIPTIONS_AVAILABLE_FOR_PURCHASE: {
icon: SILK_ICONS.creditcards,
name: "Role Subscriptions: Has Purchasable",
name: "Subscriptions: Purchasable",
},
ROLE_SUBSCRIPTIONS_ENABLED: {
icon: SILK_ICONS.creditcards,
name: "Subscriptions: Enabled",
},
ROLE_SUBSCRIPTIONS_ENABLED: {icon: SILK_ICONS.creditcards},
ROLE_SUBSCRIPTIONS_ENABLED_FOR_PURCHASE: {
icon: SILK_ICONS.creditcards,
name: "Role Subscriptions: Has Purchasable",
name: "Subscriptions: Purchasable",
deprecated: true,
},
SEVEN_DAY_THREAD_ARCHIVE: {
@ -406,8 +427,14 @@ module.exports.GuildFeaturesFormatted = {
icon: SILK_ICONS.book_tabs,
name: "Summaries (General Access)",
},
SUMMARIES_DISABLED_BY_USER: {icon: SILK_ICONS.book_tabs_delete},
SUMMARIES_ENABLED_BY_USER: {icon: SILK_ICONS.book_tabs},
SUMMARIES_DISABLED_BY_USER: {
icon: SILK_ICONS.book_tabs_delete,
name: "Summaries: User Disabled",
},
SUMMARIES_ENABLED_BY_USER: {
icon: SILK_ICONS.book_tabs,
name: "Summaries: User Enabled",
},
SUMMARIES_LONG_LOOKBACK: {
icon: SILK_ICONS.book_tabs,
name: "Summaries: Long Lookback",
@ -461,7 +488,11 @@ module.exports.GuildFeaturesFormatted = {
VIDEO_BITRATE_ENHANCED: {icon: SILK_ICONS.monitor_add},
VIDEO_QUALITY_720_60FPS: {icon: SILK_ICONS.monitor_add},
VIDEO_QUALITY_1080_60FPS: {icon: SILK_ICONS.monitor_add},
VIP_REGIONS: {icon: SILK_ICONS.microphone, name: "VIP Voice Regions"},
VIP_REGIONS: {
icon: SILK_ICONS.microphone,
name: "VIP Voice Regions",
deprecated: true,
},
VOICE_CHANNEL_EFFECTS: {icon: SILK_ICONS.wand, deprecated: true},
VOICE_IN_THREADS: {icon: SILK_ICONS.microphone},
WELCOME_SCREEN_ENABLED: {