mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-14 09:40:10 +00:00
fix(bot): use ParseHid for input check in CreateNotFoundError
This commit is contained in:
parent
7965e15282
commit
e93609df91
1 changed files with 3 additions and 2 deletions
|
|
@ -169,15 +169,16 @@ public static class ContextEntityArgumentsExt
|
||||||
public static string CreateNotFoundError(this Context ctx, string entity, string input)
|
public static string CreateNotFoundError(this Context ctx, string entity, string input)
|
||||||
{
|
{
|
||||||
var isIDOnlyQuery = ctx.System == null || ctx.MatchFlag("id", "by-id");
|
var isIDOnlyQuery = ctx.System == null || ctx.MatchFlag("id", "by-id");
|
||||||
|
var inputIsHid = HidUtils.ParseHid(input) != null;
|
||||||
|
|
||||||
if (isIDOnlyQuery)
|
if (isIDOnlyQuery)
|
||||||
{
|
{
|
||||||
if (input.Length >= 5 && input.Length <= 6)
|
if (inputIsHid)
|
||||||
return $"{entity} with ID \"{input}\" not found.";
|
return $"{entity} with ID \"{input}\" not found.";
|
||||||
return $"{entity} not found. Note that a {entity.ToLower()} ID is 5 or 6 characters long.";
|
return $"{entity} not found. Note that a {entity.ToLower()} ID is 5 or 6 characters long.";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (input.Length >= 5 && input.Length <= 6)
|
if (inputIsHid)
|
||||||
return $"{entity} with ID or name \"{input}\" not found.";
|
return $"{entity} with ID or name \"{input}\" not found.";
|
||||||
return $"{entity} with name \"{input}\" not found. Note that a {entity.ToLower()} ID is 5 or 6 characters long.";
|
return $"{entity} with name \"{input}\" not found. Note that a {entity.ToLower()} ID is 5 or 6 characters long.";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue