Ejemplo n.º 1
0
 public static void InsertField(this Messaging.IEmbed embed, int index, string name, object value, bool inline = false)
 {
     embed.InsertField(index, new Messaging.EmbedField(name, value)
     {
         Inline = inline
     });
 }
Ejemplo n.º 2
0
 public static void AddField(this Messaging.IEmbed embed, string name, object value, bool inline = false)
 {
     embed.AddField(new Messaging.EmbedField(name, value)
     {
         Inline = inline
     });
 }
Ejemplo n.º 3
0
 public static void AddPage(this IPaginatedMessage message, Messaging.IEmbed embed)
 {
     message.AddPage(new Message()
     {
         Embed = embed
     });
 }
Ejemplo n.º 4
0
        public static Embed ToDiscordEmbed(this Messaging.IEmbed embed)
        {
            EmbedBuilder embedBuilder = new EmbedBuilder();

            embedBuilder.WithTitle(embed.Title);
            embedBuilder.WithImageUrl(embed.ImageUrl);
            embedBuilder.WithThumbnailUrl(embed.ThumbnailUrl);
            embedBuilder.WithDescription(embed.Description);
            embedBuilder.WithFooter(embed.Footer);
            embedBuilder.WithUrl(embed.Url);

            if (embed.Color.HasValue)
            {
                embedBuilder.WithColor(embed.Color.Value.ToDiscordColor());
            }

            foreach (Messaging.IEmbedField field in embed.Fields)
            {
                embedBuilder.AddField(field.Name, field.Value, field.Inline);
            }

            return(embedBuilder.Build());
        }
Ejemplo n.º 5
0
 public static void SetColor(this Messaging.IEmbed embed, Color color)
 {
     embed.Color = color.ToSystemDrawingColor();
 }
Ejemplo n.º 6
0
 public static void SetColor(this Messaging.IEmbed embed, System.Drawing.Color color)
 {
     embed.Color = color;
 }