2024-08-04 23:46:10 +00:00
|
|
|
using TwitchChatTTS.Twitch.Socket.Messages;
|
|
|
|
|
|
|
|
namespace TwitchChatTTS.Chat.Commands.Parameters
|
|
|
|
{
|
|
|
|
public class MentionParameter : CommandParameter
|
|
|
|
{
|
|
|
|
public MentionParameter(string name, bool optional = false) : base(name, optional)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2024-08-12 19:45:17 +00:00
|
|
|
public override bool Validate(string value, TwitchChatFragment[] fragments)
|
2024-08-04 23:46:10 +00:00
|
|
|
{
|
2024-08-12 19:45:17 +00:00
|
|
|
return value.StartsWith('@') && fragments.Any(f => f.Text == value && f.Mention != null);
|
2024-08-04 23:46:10 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|