TwitchChat/TwitchChatMessage.cs
using System;
using System.Collections.Generic;
namespace TwitchAPI;
public class TwitchChatMessage
{
/// <summary>
/// The user that sent the message.
/// </summary>
public TwitchChatUser User { get; private set; }
/// <summary>
/// The unique identifier of the message.
/// </summary>
public Guid Id { get; internal set; } = Guid.Empty;
/// <summary>
/// The username of the user that sent the message.
/// </summary>
public string Username => User.Name;
/// <summary>
/// The contents of the message.
/// </summary>
public string Message { get; private set; }
/// <summary>
/// The emotes that are contained in the message.
/// </summary>
public List<TwitchChatEmote> Emotes { get; internal set; } = new();
/// <summary>
/// The timestamp of when the message was sent (in local time).
/// </summary>
public DateTime Timestamp { get; internal set; } = DateTime.Now;
/// <summary>
/// Whether the message only contains emotes.
/// </summary>
public bool OnlyContainsEmotes { get; internal set; } = false;
/// <summary>
/// Whether the message is the user's first message in the chat.
/// </summary>
public bool IsFirstMessage { get; internal set; } = false;
public TwitchChatMessage( TwitchChatUser user, string message )
{
User = user;
Message = message;
}
public override string ToString()
{
return $"{Username}: {Message}";
}
}