title: Add a field to a c# embedded discord message
body: <p>In my Wpf C# Document I needed to find a way to send embedded messages to a webhook, I found some examples on the internet and put them into my file. Although this, I still couldn't find how to add fields to the embedded message, here is the code:</p>
  
  <pre><code>public class Json
  {
      // 'Username' value
      [JsonProperty("username")]
      public string username { get; set; }
      // 'Avatar' value
      [JsonProperty("avatar_url")]
      // 'Content' value --&gt; Always empty because we are using embed
      public string avatarurl { get; set; }
      [JsonProperty("content")]
      public string content { get; set; }
      // 'Embed' array value
      [JsonProperty("embeds")]
      public List&lt;Embed&gt; embeds { get; set; }
  }
  
  /*
     Json class to compile the single embed
     Action: n/a
  */
  public class Embed
  {
      [JsonProperty("author")]
      public Author author { get; set; }
      [JsonProperty("title")]
      public string title { get; set; }
      [JsonProperty("url")]
      public string url { get; set; }
      [JsonProperty("description")]
      public string description { get; set; }
      [JsonProperty("color")]
      public int color { get; set; }
      [JsonProperty("fields")]
      public List&lt;Fields&gt; fields { get; set; }
      [JsonProperty("thumbnail")]
      public Thumbnail thumbnail { get; set; }
      [JsonProperty("image")]
      public Image image { get; set; }
      [JsonProperty("footer")]
      public Footer footer { get; set; }
  
  }
  
  /*
     Json class to compile the author in an embed
     Action: n/a
  */
  public class Author
  {
      [JsonProperty("name")]
      public string name { get; set; }
      [JsonProperty("url")]
      public string url { get; set; }
      [JsonProperty("icon_url")]
      public string iconurl { get; set; }
  }
  
  
  /*
     Json class to compile the fields in an embed
     Action: n/a
  */
  
  
  /*
     Json class to compile the thumbnail in an embed
     Action: n/a
  */
  public class Thumbnail
  {
      [JsonProperty("url")]
      public string url { get; set; }
  }
  
  /*
     Json class to compile the image in an embed
     Action: n/a
  */
  public class Image
  {
      [JsonProperty("url")]
      public string url { get; set; }
  }
  
  /*
     Json class to compile the footer in an embed
     Action: n/a
  */
  public class Footer
  {
      [JsonProperty("text")]
      public string text { get; set; }
      [JsonProperty("icon_url")]
      public string iconurl { get; set; }
  }
  
  /*
     Json class to compile the config
     Action: CONFIG
  */
  public class Config
  {
      [JsonProperty("webhook_url")]
      public string webhook { get; set; }
      [JsonProperty("json")]
      public Json json { get; set; }
  }
  public class Fields
  {
  }
  </code></pre>
  
  <p>Then, in a EmbedBuilder.cs class I have:</p>
  
  <pre><code>public class EmbedBuilder
  {
      /*
          Builds the JSON according to the local values
          Action: COMPILE/EXECUTE
      */
      public static void buildEmbed()
      {
          Json json = new Json()
          {
              embeds = new List&lt;Embed&gt;()
              {
                  new Embed
                  {
                      author = new Author
                      {
                          name = "",
                          iconurl = "",
                      },
                      title = "",
                      url = "",
                      color = 14957895,
                      description = "",
                      thumbnail = new Thumbnail
                      {
                          url = "",
                      },
                      image = new Image
                      {
                          url = ""
                      },
                      footer = new Footer
                      {
                          text = "",
                          iconurl = "",
                      }
                  }
              }
  
          };
          // Call the HTTP client and execute request
          HTTP.MakeRequest(Properties.Settings.Default.discordhook, Newtonsoft.Json.JsonConvert.SerializeObject(json));
  
      }
  
      /*
          Compiles the local values into the format provided in Json.cs. Must have run the webhook once (soon will be dynamic)
          Action: COMPILE/SAVE
      */
      public static string saveEmbed()
      {
          // Make a new config
          Config json = new Config()
          {
              webhook = Properties.Settings.Default.discordhook,
              json = new Json
              {
                  embeds = new List&lt;Embed&gt;()
                  {
                      new Embed
                      {
                          author = new Author
                          {
                              name = "",
                              iconurl = "",
                          },
                          title = "",
                          url = "",
                          color = ,
                          description = "",
                          thumbnail = new Thumbnail
                          {
                              url = "",
                          },
                          image = new Image
                          {
                              url = ""
                          },
                          footer = new Footer
                          {
                              text = "",
                              iconurl = "",
                          }
                      }
                  }
              }
          };
          // Return a serialized value
          return JsonConvert.SerializeObject(json);
  
      }
  }
  </code></pre>
  
  <p>How would I be able to add a discord embedded field to my message, here is a picture of one: <a href="https://i.stack.imgur.com/lphW9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lphW9.png" alt="enter image description here"></a> </p>
  
  <p>That is just an example that I found on the internet and I'm not specifically looking for how to create the same thing exactly, just on how to add a field.</p>