2021-08-27 15:03:47 +00:00
|
|
|
#nullable enable
|
2020-06-11 21:20:46 +00:00
|
|
|
using PluralKit.Core;
|
|
|
|
|
2021-11-27 02:10:56 +00:00
|
|
|
namespace PluralKit.Bot;
|
|
|
|
|
|
|
|
public struct ProxyMatch
|
2020-06-11 21:20:46 +00:00
|
|
|
{
|
2021-11-27 02:10:56 +00:00
|
|
|
public ProxyMember Member;
|
|
|
|
public string? Content;
|
|
|
|
public ProxyTag? ProxyTags;
|
2021-08-27 15:03:47 +00:00
|
|
|
|
2021-11-27 02:10:56 +00:00
|
|
|
public string? ProxyContent
|
|
|
|
{
|
|
|
|
get
|
2020-06-11 21:20:46 +00:00
|
|
|
{
|
2021-11-27 02:10:56 +00:00
|
|
|
// Add the proxy tags into the proxied message if that option is enabled
|
|
|
|
// Also check if the member has any proxy tags - some cases autoproxy can return a member with no tags
|
|
|
|
if (Member.KeepProxy && Content != null && ProxyTags != null)
|
|
|
|
return $"{ProxyTags.Value.Prefix}{Content}{ProxyTags.Value.Suffix}";
|
2020-06-11 21:20:46 +00:00
|
|
|
|
2021-11-27 02:10:56 +00:00
|
|
|
return Content;
|
2020-06-11 21:20:46 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|