2021-08-27 11:03:47 -04:00
|
|
|
#nullable enable
|
2020-06-11 23:20:46 +02:00
|
|
|
using PluralKit.Core;
|
|
|
|
|
2021-11-26 21:10:56 -05:00
|
|
|
namespace PluralKit.Bot;
|
|
|
|
|
|
|
|
public struct ProxyMatch
|
2020-06-11 23:20:46 +02:00
|
|
|
{
|
2021-11-26 21:10:56 -05:00
|
|
|
public ProxyMember Member;
|
|
|
|
public string? Content;
|
|
|
|
public ProxyTag? ProxyTags;
|
2021-08-27 11:03:47 -04:00
|
|
|
|
2021-11-26 21:10:56 -05:00
|
|
|
public string? ProxyContent
|
|
|
|
{
|
|
|
|
get
|
2020-06-11 23:20:46 +02:00
|
|
|
{
|
2021-11-26 21:10:56 -05: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 23:20:46 +02:00
|
|
|
|
2021-11-26 21:10:56 -05:00
|
|
|
return Content;
|
2020-06-11 23:20:46 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|