fix: fetch guild settings for server tag in system card

This commit is contained in:
spiral 2021-08-25 12:30:42 -04:00
parent 83212b4bb2
commit 0d583a2a6b
No known key found for this signature in database
GPG Key ID: A6059F0CA0E1BD31
2 changed files with 8 additions and 3 deletions

View File

@ -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)*"));
}

View File

@ -16,5 +16,8 @@
public AutoproxyMode AutoproxyMode { get; } = AutoproxyMode.Off;
public MemberId? AutoproxyMember { get; }
public string? Tag { get; }
public bool TagEnabled { get; }
}
}