!server: make sure we only show information for other servers when it's public information
This commit is contained in:
parent
d1402b2400
commit
52980a2515
1 changed files with 11 additions and 1 deletions
|
@ -22,6 +22,11 @@ export async function serverInfo(pluginData: PluginData<UtilityPluginType>, serv
|
|||
return null;
|
||||
}
|
||||
|
||||
const features = (restGuild || guildPreview).features;
|
||||
if (!thisServer && !features.includes("DISCOVERABLE")) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const embed: EmbedOptions = {
|
||||
fields: [],
|
||||
color: parseInt("6b80cf", 16),
|
||||
|
@ -47,7 +52,6 @@ export async function serverInfo(pluginData: PluginData<UtilityPluginType>, serv
|
|||
basicInformation.push(`Voice region: **${thisServer.region}**`);
|
||||
}
|
||||
|
||||
const features = (guildPreview || restGuild).features;
|
||||
if (features.length > 0) {
|
||||
basicInformation.push(`Features: ${features.join(", ")}`);
|
||||
}
|
||||
|
@ -157,5 +161,11 @@ export async function serverInfo(pluginData: PluginData<UtilityPluginType>, serv
|
|||
value: otherStats.join("\n") + embedPadding,
|
||||
});
|
||||
|
||||
if (!thisServer) {
|
||||
embed.footer = {
|
||||
text: "⚠️ Only showing publicly available information for this server",
|
||||
};
|
||||
}
|
||||
|
||||
return embed;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue