Add server-specific system tag

This commit is contained in:
spiral
2021-08-02 17:22:06 -04:00
parent 28bcb35bb2
commit 9d4006b056
11 changed files with 163 additions and 7 deletions

View File

@@ -23,10 +23,18 @@ namespace PluralKit.Core
public bool AllowAutoproxy { get; }
public string? Color { get; }
public string ProxyName(MessageContext ctx) => ctx.SystemTag != null
? $"{ServerName ?? DisplayName ?? Name} {ctx.SystemTag}"
: ServerName ?? DisplayName ?? Name;
public string ProxyName(MessageContext ctx)
{
var memberName = ServerName ?? DisplayName ?? Name;
if (!ctx.TagEnabled)
return memberName;
if (ctx.SystemGuildTag != null)
return $"{memberName} {ctx.SystemGuildTag}";
else if (ctx.SystemTag != null)
return $"{memberName} {ctx.SystemTag}";
else return memberName;
}
public string? ProxyAvatar(MessageContext ctx) => ServerAvatar ?? Avatar ?? ctx.SystemAvatar;
public ProxyMember() { }