﻿using System.Collections.Generic;

namespace NetIRC.Messages
{
    public class NoticeMessage : IRCMessage, IServerMessage, IClientMessage
    {
        public string From { get; }
        public string Target { get; }
        public string Message { get; }

        public NoticeMessage(ParsedIRCMessage parsedMessage)
        {
            From = parsedMessage.Prefix.From;
            Target = parsedMessage.Parameters[0];
            Message = parsedMessage.Trailing;
        }

        public NoticeMessage(string target, string text)
        {
            Target = target;
            Message = text;
        }

        public IEnumerable<string> Tokens => new[] { "NOTICE", Target, Message };
    }
}

﻿using System.Collections.Generic;

namespace NetIRC.Messages
{
    public class NoticeMessage : IRCMessage, IServerMessage, IClientMessage
    {
        public string From { get; }
        public string Target { get; }
        public string Message { get; }

        public NoticeMessage(ParsedIRCMessage parsedMessage)
        {
            From = parsedMessage.Prefix.From;
            Target = parsedMessage.Parameters[0];
            Message = parsedMessage.Trailing;
        }

        public NoticeMessage(string target, string text)
        {
            Target = target;
            Message = text;
        }

        public bool IsChannelMessage => Target[0] == '#';

        public IEnumerable<string> Tokens => new[] { "NOTICE", Target, Message };
    }
}

Add property to identity a Channel Notice
Add property to identity a Channel Notice
