2024-08-04 19:46:10 -04: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 15:45:17 -04:00
|
|
|
public override bool Validate(string value, TwitchChatFragment[] fragments)
|
2024-08-04 19:46:10 -04:00
|
|
|
{
|
2024-08-12 15:45:17 -04:00
|
|
|
return value.StartsWith('@') && fragments.Any(f => f.Text == value && f.Mention != null);
|
2024-08-04 19:46:10 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|