Add displayname to PK export/import

- Add display_name property to member on PK export
- Set display_name if provided when importing from PK export file
This commit is contained in:
Noko 2019-09-28 23:29:32 -05:00
parent 0ec522ca0a
commit 633c181e84

View File

@ -49,6 +49,7 @@ namespace PluralKit.Bot
{
Id = member.Hid,
Name = member.Name,
DisplayName = member.DisplayName,
Description = member.Description,
Birthday = member.Birthday != null ? Formats.DateExportFormat.Format(member.Birthday.Value) : null,
Pronouns = member.Pronouns,
@ -117,6 +118,7 @@ namespace PluralKit.Bot
// Apply member info
member.Name = dataMember.Name;
if (dataMember.DisplayName != null) member.DisplayName = dataMember.DisplayName;
if (dataMember.Description != null) member.Description = dataMember.Description;
if (dataMember.Color != null) member.Color = dataMember.Color;
if (dataMember.AvatarUrl != null) member.AvatarUrl = dataMember.AvatarUrl;
@ -173,6 +175,7 @@ namespace PluralKit.Bot
{
[JsonProperty("id")] public string Id;
[JsonProperty("name")] public string Name;
[JsonProperty("display_name")] public string DisplayName;
[JsonProperty("description")] public string Description;
[JsonProperty("birthday")] public string Birthday;
[JsonProperty("pronouns")] public string Pronouns;