Archived
1
0
Fork 0
This repository has been archived on 2024-05-21. You can view files and clone it, but cannot push or open issues or pull requests.
maki/Maki/Structures/Messages/Message.cs
2017-05-14 14:02:51 +02:00

111 lines
2.8 KiB
C#

using Maki.Structures.Embeds;
using Maki.Structures.Users;
using Newtonsoft.Json;
using System;
namespace Maki.Structures.Messages
{
/// <summary>
/// Discord API Message structure
/// </summary>
internal struct Message
{
/// <summary>
/// id of the message
/// </summary>
[JsonProperty("id")]
public ulong Id;
/// <summary>
/// id of the channel the message was sent in
/// </summary>
[JsonProperty("channel_id")]
public ulong ChannelId;
/// <summary>
/// the author of this message (doesn't contain a valid user when sent by webhook)
/// </summary>
[JsonProperty("author")]
public User User;
/// <summary>
/// contents of the message
/// </summary>
[JsonProperty("content")]
public string Content;
/// <summary>
/// when this message was sent
/// </summary>
[JsonProperty("timestamp")]
public DateTime Sent;
/// <summary>
/// when this message was edited (or null if never)
/// </summary>
[JsonProperty("edited_timestamp")]
public DateTime? Edited;
/// <summary>
/// whether this was a TTS message
/// </summary>
[JsonProperty("tts")]
public bool IsTTS;
/// <summary>
/// whether this message mentions everyone
/// </summary>
[JsonProperty("mention_everyone")]
public bool MentioningEveryone;
/// <summary>
/// users specifically mentioned in the message
/// </summary>
[JsonProperty("mentions")]
public User[] Mentions;
/// <summary>
/// roles specifically mentioned in this message
/// </summary>
[JsonProperty("mention_roles")]
public ulong[] MentionsRoles;
/// <summary>
/// any attached files
/// </summary>
[JsonProperty("attachments")]
public Attachment[] Attachments;
/// <summary>
/// any embedded content
/// </summary>
[JsonProperty("embeds")]
public Embed[] Embeds;
/// <summary>
/// reactions to the message
/// Not actually populated ever???
/// </summary>
[JsonProperty("reactions")]
public MessageReaction[] Reactions;
/// <summary>
/// used for validating a message was sent
/// </summary>
[JsonProperty("nonce")]
public long? Nonce;
/// <summary>
/// whether this message is pinned
/// </summary>
[JsonProperty("pinned")]
public bool IsPinned;
/// <summary>
/// if the message is generated by a webhook, this is the webhook's id
/// </summary>
[JsonProperty("webhook_id")]
public string WebhookId;
}
}