feat: dynamically show primary command prefix

This commit is contained in:
rladenson 2024-12-31 08:09:18 -07:00 committed by Petal Ladenson
parent 1d50022d6d
commit edfc6714d6
30 changed files with 202 additions and 197 deletions

View file

@ -36,11 +36,11 @@ public static class Errors
public static PKError NotOwnInfo => new("You cannot look up private information of another system.");
public static PKError NoSystemError =>
new("You do not have a system registered with PluralKit. To create one, type `pk;system new`.");
public static PKError NoSystemError(string prefix) =>
new($"You do not have a system registered with PluralKit. To create one, type `{prefix}system new`.");
public static PKError ExistingSystemError => new(
"You already have a system registered with PluralKit. To view it, type `pk;system`. If you'd like to delete your system and start anew, type `pk;system delete`, or if you'd like to unlink this account from it, type `pk;unlink`.");
public static PKError ExistingSystemError(string prefix) => new(
$"You already have a system registered with PluralKit. To view it, type `{prefix}system`. If you'd like to delete your system and start anew, type `{prefix}system delete`, or if you'd like to unlink this account from it, type `{prefix}unlink`.");
public static PKError MissingMemberError =>
new PKSyntaxError("You need to specify a member to run this command on.");
@ -61,8 +61,8 @@ public static class Errors
public static PKError AccountAlreadyLinked => new("That account is already linked to your system.");
public static PKError AccountNotLinked => new("That account isn't linked to your system.");
public static PKError UnlinkingLastAccount => new(
"Since this is the only account linked to this system, you cannot unlink it (as that would leave your system account-less). If you would like to delete your system, use `pk;system delete`.");
public static PKError UnlinkingLastAccount(string prefix) => new(
$"Since this is the only account linked to this system, you cannot unlink it (as that would leave your system account-less). If you would like to delete your system, use `{prefix}system delete`.");
public static PKError MemberLinkCancelled => new("Member link cancelled.");
public static PKError MemberUnlinkCancelled => new("Member unlink cancelled.");
@ -120,8 +120,8 @@ public static class Errors
public static PKError UrlTooLong(string url) =>
new($"The given URL is too long ({url.Length}/{Limits.MaxUriLength} characters).");
public static PKError AccountInOtherSystem(PKSystem system, SystemConfig config) =>
new($"The mentioned account is already linked to another system (see `pk;system {system.DisplayHid(config)}`).");
public static PKError AccountInOtherSystem(PKSystem system, SystemConfig config, string prefix) =>
new($"The mentioned account is already linked to another system (see `{prefix}system {system.DisplayHid(config)}`).");
public static PKError SameSwitch(ICollection<PKMember> members, LookupContext ctx)
{
@ -171,10 +171,10 @@ public static class Errors
$"That member does not have the proxy tag {tagToRemove.ProxyString.AsCode()}. The member currently has these tags: {member.ProxyTagsString()}");
public static PKError LegacyAlreadyHasProxyTag(ProxyTag requested, PKMember member, Context ctx) => new(
$"This member already has more than one proxy tag set: {member.ProxyTagsString()}\nConsider using the {$"pk;member {member.Reference(ctx)} proxy add {requested.ProxyString}".AsCode()} command instead.");
$"This member already has more than one proxy tag set: {member.ProxyTagsString()}\nConsider using the {$"{ctx.DefaultPrefix}member {member.Reference(ctx)} proxy add {requested.ProxyString}".AsCode()} command instead.");
public static PKError EmptyProxyTags(PKMember member, Context ctx) => new(
$"The example proxy `text` is equivalent to having no proxy tags at all, since there are no symbols or brackets on either end. If you'd like to clear your proxy tags, use `pk;member {member.Reference(ctx)} proxy clear`.");
$"The example proxy `text` is equivalent to having no proxy tags at all, since there are no symbols or brackets on either end. If you'd like to clear your proxy tags, use `{ctx.DefaultPrefix}member {member.Reference(ctx)} proxy clear`.");
public static PKError GenericCancelled() => new("Operation cancelled.");