fix: apply requested changes

This commit is contained in:
Jake Fulmine 2022-08-27 15:15:14 +02:00
parent cd14e6409b
commit 67d5118c9c
5 changed files with 14 additions and 8 deletions

View File

@ -159,7 +159,8 @@ public class Groups
+ $"To clear it, type `pk;group {reference} displayname -clear`." + $"To clear it, type `pk;group {reference} displayname -clear`."
+ $"To print the raw display name, type `pk;group {reference} displayname -raw`."); + $"To print the raw display name, type `pk;group {reference} displayname -raw`.");
eb.Footer(new Embed.EmbedFooter($"Using {target.DisplayName.Length}/{Limits.MaxGroupNameLength} characters.")); if (ctx.System?.Id == target.System)
eb.Footer(new Embed.EmbedFooter($"Using {target.DisplayName.Length}/{Limits.MaxGroupNameLength} characters."));
await ctx.Reply(embed: eb.Build()); await ctx.Reply(embed: eb.Build());
} }
@ -579,7 +580,7 @@ public class Groups
public async Task DisplayId(Context ctx, PKGroup target) public async Task DisplayId(Context ctx, PKGroup target)
{ {
await ctx.Reply($"{target.Hid}"); await ctx.Reply(target.Hid);
} }
private async Task<PKSystem> GetGroupSystem(Context ctx, PKGroup target) private async Task<PKSystem> GetGroupSystem(Context ctx, PKGroup target)

View File

@ -143,6 +143,6 @@ public class Member
public async Task DisplayId(Context ctx, PKMember target) public async Task DisplayId(Context ctx, PKMember target)
{ {
await ctx.Reply($"{target.Hid}"); await ctx.Reply(target.Hid);
} }
} }

View File

@ -336,7 +336,7 @@ public class MemberEdit
.Title("Member names") .Title("Member names")
.Footer(new Embed.EmbedFooter( .Footer(new Embed.EmbedFooter(
$"Member ID: {target.Hid} | Active name in bold. Server name overrides display name, which overrides base name." $"Member ID: {target.Hid} | Active name in bold. Server name overrides display name, which overrides base name."
+ (target.DisplayName != null ? $" Using {target.DisplayName.Length}/{Limits.MaxMemberNameLength} characters for the display name." : "") + (target.DisplayName != null && ctx.System?.Id == target.System ? $" Using {target.DisplayName.Length}/{Limits.MaxMemberNameLength} characters for the display name." : "")
+ (memberGuildConfig?.DisplayName != null ? $" Using {memberGuildConfig?.DisplayName.Length}/{Limits.MaxMemberNameLength} characters for the server name." : ""))); + (memberGuildConfig?.DisplayName != null ? $" Using {memberGuildConfig?.DisplayName.Length}/{Limits.MaxMemberNameLength} characters for the server name." : "")));
var showDisplayName = target.NamePrivacy.CanAccess(lcx); var showDisplayName = target.NamePrivacy.CanAccess(lcx);

View File

@ -31,7 +31,9 @@ public class Random
if (members == null || !members.Any()) if (members == null || !members.Any())
throw new PKError( throw new PKError(
"Your system has no members! Please create at least one member before using this command."); ctx.System?.Id == target.Id ?
"Your system has no members! Please create at least one member before using this command." :
"This system has no members!");
var randInt = randGen.Next(members.Count); var randInt = randGen.Next(members.Count);
await ctx.Reply(embed: await _embeds.CreateMemberEmbed(target, members[randInt], ctx.Guild, await ctx.Reply(embed: await _embeds.CreateMemberEmbed(target, members[randInt], ctx.Guild,
@ -53,7 +55,9 @@ public class Random
if (groups == null || !groups.Any()) if (groups == null || !groups.Any())
throw new PKError( throw new PKError(
"Your system has no groups! Please create at least one group before using this command."); ctx.System?.Id == target.Id ?
"Your system has no groups! Please create at least one group before using this command." :
$"This system has no groups!");
var randInt = randGen.Next(groups.Count()); var randInt = randGen.Next(groups.Count());
await ctx.Reply(embed: await _embeds.CreateGroupEmbed(ctx, target, groups.ToArray()[randInt])); await ctx.Reply(embed: await _embeds.CreateGroupEmbed(ctx, target, groups.ToArray()[randInt]));
@ -70,7 +74,8 @@ public class Random
if (members == null || !members.Any()) if (members == null || !members.Any())
throw new PKError( throw new PKError(
"This group has no members! Please add at least one member to this group before using this command."); "This group has no members!"
+ ( ctx.System?.Id == group.System ? " Please add at least one member to this group before using this command." : ""));
if (!ctx.MatchFlag("all", "a")) if (!ctx.MatchFlag("all", "a"))
members = members.Where(g => g.MemberVisibility == PrivacyLevel.Public); members = members.Where(g => g.MemberVisibility == PrivacyLevel.Public);

View File

@ -39,6 +39,6 @@ public class System
if (target == null) if (target == null)
throw Errors.NoSystemError; throw Errors.NoSystemError;
await ctx.Reply($"{target.Hid}"); await ctx.Reply(target.Hid);
} }
} }