mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 21:16:49 +00:00
18 lines
No EOL
463 B
C#
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;
|
|
}
|
|
} |