From 633c181e8408717a0737305fa1baa2f1c33a3439 Mon Sep 17 00:00:00 2001 From: Noko Date: Sat, 28 Sep 2019 23:29:32 -0500 Subject: [PATCH] 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 --- PluralKit.Core/DataFiles.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/PluralKit.Core/DataFiles.cs b/PluralKit.Core/DataFiles.cs index 346ab224..d5b7a24b 100644 --- a/PluralKit.Core/DataFiles.cs +++ b/PluralKit.Core/DataFiles.cs @@ -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;