2019-04-29 17:43:09 +00:00
namespace PluralKit.Bot {
public static class Errors {
2019-04-29 18:28:53 +00:00
// TODO: is returning constructed errors and throwing them at call site a good idea, or should these be methods that insta-throw instead?
2019-04-29 18:36:09 +00:00
2019-04-29 17:43:09 +00:00
public static PKError NotOwnSystemError = > new PKError ( $"You can only run this command on your own system." ) ;
public static PKError NotOwnMemberError = > new PKError ( $"You can only run this command on your own member." ) ;
public static PKError NoSystemError = > new PKError ( "You do not have a system registered with PluralKit. To create one, type `pk;system new`." ) ;
2019-05-11 21:56:56 +00:00
public static PKError ExistingSystemError = > new PKError ( "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`." ) ;
2019-04-29 17:43:09 +00:00
public static PKError MissingMemberError = > new PKSyntaxError ( "You need to specify a member to run this command on." ) ;
2019-04-29 18:28:53 +00:00
2019-04-29 18:36:09 +00:00
public static PKError SystemNameTooLongError ( int length ) = > new PKError ( $"System name too long ({length}/{Limits.MaxSystemNameLength} characters)." ) ;
public static PKError SystemTagTooLongError ( int length ) = > new PKError ( $"System tag too long ({length}/{Limits.MaxSystemTagLength} characters)." ) ;
public static PKError DescriptionTooLongError ( int length ) = > new PKError ( $"Description too long ({length}/{Limits.MaxDescriptionLength} characters)." ) ;
public static PKError MemberNameTooLongError ( int length ) = > new PKError ( $"Member name too long ({length}/{Limits.MaxMemberNameLength} characters)." ) ;
public static PKError MemberPronounsTooLongError ( int length ) = > new PKError ( $"Member pronouns too long ({length}/{Limits.MaxMemberNameLength} characters)." ) ;
2019-05-11 21:56:56 +00:00
2019-05-13 20:44:49 +00:00
public static PKError InvalidColorError ( string color ) = > new PKError ( $"\" { color } \ " is not a valid color. Color must be in hex format (eg. #ff0000)." ) ;
public static PKError BirthdayParseError ( string birthday ) = > new PKError ( $"\" { birthday } \ " could not be parsed as a valid date. Try a format like \"2016-12-24\" or \"May 3 1996\"." ) ;
2019-05-13 20:56:22 +00:00
public static PKError ProxyMustHaveText = > new PKSyntaxError ( "Example proxy message must contain the string 'text'." ) ;
public static PKError ProxyMultipleText = > new PKSyntaxError ( "Example proxy message must contain the string 'text' exactly once." ) ;
2019-05-13 21:08:44 +00:00
public static PKError MemberDeleteCancelled = > new PKError ( $"Member deletion cancelled. Stay safe! {Emojis.ThumbsUp}" ) ;
2019-04-29 17:43:09 +00:00
}
}