You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
698 B
19 lines
698 B
using DiscordChatExporter.Core.Discord.Data;
|
|
using System;
|
|
using System.Linq;
|
|
|
|
namespace DiscordChatExporter.Core.Exporting.Filtering
|
|
{
|
|
public class MentionsMessageFilter : MessageFilter
|
|
{
|
|
private readonly string _value;
|
|
|
|
public MentionsMessageFilter(string value) => _value = value;
|
|
|
|
public override bool Filter(Message message) =>
|
|
message.MentionedUsers.Any(user =>
|
|
string.Equals(_value, user.Name, StringComparison.OrdinalIgnoreCase) ||
|
|
string.Equals(_value, user.FullName, StringComparison.OrdinalIgnoreCase) ||
|
|
string.Equals(_value, user.Id.ToString(), StringComparison.OrdinalIgnoreCase));
|
|
}
|
|
} |