PluralKit/PluralKit.Core/Database/Functions/MessageContextExt.cs

18 lines
463 B
C#
Raw Normal View History

#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;
2024-11-19 17:35:09 -07:00
var format = ctx.GuildNameFormat ?? ctx.NameFormat ?? ProxyMember.DefaultFormat;
if (!format.Contains("{tag}"))
return false;
return true;
}
}