21 lines
596 B
C#
21 lines
596 B
C#
|
using Discord.WebSocket;
|
|||
|
using Newtonsoft.Json;
|
|||
|
|
|||
|
namespace MinecraftDiscordBot;
|
|||
|
|
|||
|
public abstract class Message {
|
|||
|
[JsonProperty("type")]
|
|||
|
public abstract string Type { get; }
|
|||
|
}
|
|||
|
public class TextMessage : Message {
|
|||
|
public TextMessage(SocketMessage arg) : this(arg.Author.Username, arg.Content) { }
|
|||
|
public TextMessage(string author, string content) {
|
|||
|
Author = author;
|
|||
|
Content = content;
|
|||
|
}
|
|||
|
public override string Type => "text";
|
|||
|
[JsonProperty("author")]
|
|||
|
public string Author { get; }
|
|||
|
[JsonProperty("message")]
|
|||
|
public string Content { get; }
|
|||
|
}
|