PluralKit/PluralKit.Core/Database/Functions/MessageContextExt.cs
2024-12-05 17:26:59 -07:00

18 lines
No EOL
463 B
C#

#nullable enable
namespace PluralKit.Core;
public static class MessageContextExt
{
public static bool HasProxyableTag(this MessageContext ctx)
{
var tag = ctx.SystemGuildTag ?? ctx.SystemTag;
if (!ctx.TagEnabled || tag == null)
return false;
var format = ctx.GuildNameFormat ?? ctx.NameFormat ?? ProxyMember.DefaultFormat;
if (!format.Contains("{tag}"))
return false;
return true;
}
}