Fix importing brackets from Tupperbox. Closes #123

This commit is contained in:
Ske 2019-10-18 13:34:54 +02:00
parent c4d28f64c7
commit 4ce4efcc61
2 changed files with 7 additions and 2 deletions

View File

@ -307,8 +307,8 @@ namespace PluralKit.Bot
AvatarUrl = AvatarUrl, AvatarUrl = AvatarUrl,
Birthday = Birthday, Birthday = Birthday,
Description = Description, Description = Description,
Prefix = Brackets.FirstOrDefault(), Prefix = Brackets.FirstOrDefault().NullIfEmpty(),
Suffix = Brackets.Skip(1).FirstOrDefault() // TODO: can Tupperbox members have no proxies at all? Suffix = Brackets.Skip(1).FirstOrDefault().NullIfEmpty() // TODO: can Tupperbox members have no proxies at all?
}; };
} }
} }

View File

@ -246,6 +246,11 @@ namespace PluralKit
yield break; yield break;
} }
} }
public static string NullIfEmpty(this string input)
{
return input.Trim().Length == 0 ? null : input;
}
} }
public static class Emojis { public static class Emojis {