using System; using System.Collections.Generic; using System.Drawing; using Newtonsoft.Json; namespace Global.API.Discord { /// /// Discord message data object /// public struct DiscordMessage { /// /// Message content /// public string Content; /// /// Read message to everyone on the channel /// public bool TTS; public DiscordAllowedMentions AllowedMentions; /// /// Webhook profile username to be shown /// public string Username; /// /// Webhook profile avater to be shown /// public string AvatarUrl; /// /// List of embeds /// public List Embeds; public override string ToString() { return DiscordUtil.StructToJson(this).ToString(Formatting.None); } } public struct DiscordAllowedMentions { public List Parse; public List Roles; public List Users; public override string ToString() { return DiscordUtil.StructToJson(this).ToString(Formatting.None); } } /// /// Discord embed data object /// public struct DiscordEmbed { /// /// Embed title /// public string Title; /// /// Embed description /// public string Description; /// /// Embed url /// public string Url; /// /// Embed timestamp /// public DateTime? Timestamp; /// /// Embed color /// public Color? Color; /// /// Embed footer /// public EmbedFooter? Footer; /// /// Embed image /// public EmbedMedia? Image; /// /// Embed thumbnail /// public EmbedMedia? Thumbnail; /// /// Embed video /// public EmbedMedia? Video; /// /// Embed provider /// public EmbedProvider? Provider; /// /// Embed author /// public EmbedAuthor? Author; /// /// Embed fields list /// public List Fields; public override string ToString() { return DiscordUtil.StructToJson(this).ToString(Formatting.None); } } /// /// Discord embed footer data object /// public struct EmbedFooter { /// /// Footer text /// public string Text; /// /// Footer icon /// public string IconUrl; /// /// Footer icon proxy /// public string ProxyIconUrl; public override string ToString() { return DiscordUtil.StructToJson(this).ToString(Formatting.None); } } /// /// Discord embed media data object (images/thumbs/videos) /// public struct EmbedMedia { /// /// Media url /// public string Url; /// /// Media proxy url /// public string ProxyUrl; /// /// Media height /// public int? Height; /// /// Media width /// public int? Width; public override string ToString() { return DiscordUtil.StructToJson(this).ToString(Formatting.None); } } /// /// Discord embed provider data object /// public struct EmbedProvider { /// /// Provider name /// public string Name; /// /// Provider url /// public string Url; public override string ToString() { return DiscordUtil.StructToJson(this).ToString(Formatting.None); } } /// /// Discord embed author data object /// public struct EmbedAuthor { /// /// Author name /// public string Name; /// /// Author url /// public string Url; /// /// Author icon /// public string IconUrl; /// /// Author icon proxy /// public string ProxyIconUrl; public override string ToString() { return DiscordUtil.StructToJson(this).ToString(Formatting.None); } } /// /// Discord embed field data object /// public struct EmbedField { /// /// Field name /// public string Name; /// /// Field value /// public string Value; /// /// Field align /// public bool InLine; public override string ToString() { return DiscordUtil.StructToJson(this).ToString(Formatting.None); } } }