From 0d583a2a6b5de636d6c99f860fffcecababdd29e Mon Sep 17 00:00:00 2001 From: spiral Date: Wed, 25 Aug 2021 12:30:42 -0400 Subject: [PATCH] fix: fetch guild settings for server tag in system card --- PluralKit.Bot/Services/EmbedService.cs | 8 +++++--- PluralKit.Core/Models/SystemGuildSettings.cs | 3 +++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/PluralKit.Bot/Services/EmbedService.cs b/PluralKit.Bot/Services/EmbedService.cs index 4e2e3fb3..12e1a951 100644 --- a/PluralKit.Bot/Services/EmbedService.cs +++ b/PluralKit.Bot/Services/EmbedService.cs @@ -86,11 +86,13 @@ namespace PluralKit.Bot { if (cctx.Guild != null) { - if (cctx.MessageContext.SystemGuildTag != null && cctx.MessageContext.TagEnabled) - eb.Field(new($"Tag (in server '{cctx.Guild.Name}')", cctx.MessageContext.SystemGuildTag + var guildSettings = await _repo.GetSystemGuild(conn, cctx.Guild.Id, system.Id); + + if (guildSettings.Tag != null && guildSettings.TagEnabled) + eb.Field(new($"Tag (in server '{cctx.Guild.Name}')", guildSettings.Tag .EscapeMarkdown(), true)); - if (!cctx.MessageContext.TagEnabled) + if (!guildSettings.TagEnabled) eb.Field(new($"Tag (in server '{cctx.Guild.Name}')", "*(tag is disabled in this server)*")); } diff --git a/PluralKit.Core/Models/SystemGuildSettings.cs b/PluralKit.Core/Models/SystemGuildSettings.cs index 4f9f6732..4b69bf8f 100644 --- a/PluralKit.Core/Models/SystemGuildSettings.cs +++ b/PluralKit.Core/Models/SystemGuildSettings.cs @@ -16,5 +16,8 @@ public AutoproxyMode AutoproxyMode { get; } = AutoproxyMode.Off; public MemberId? AutoproxyMember { get; } + + public string? Tag { get; } + public bool TagEnabled { get; } } } \ No newline at end of file