title: How to send file attachment with embed discord.net webhook c#
body: <p>I've tried every solution on adding an embed on a web hook but none work on my case or am I missing something?</p>
  <p>I'm using Discord.Net v2.2.0</p>
  <p>here's part of my code</p>
  <pre class="lang-cs prettyprint-override"><code>var DCW = new DiscordWebhookClient(DCWebhook)
  
  using (var client = DCW)
  {
      var eb = new EmbedBuilder();
          eb.WithDescription(&quot;some text&quot;)
        .Build();
  
      await client.SendFileAsync(filePath: &quot;file.txt&quot;, text: null, embeds: eb);
  }
  </code></pre>
  <p>this code shows an error</p>
  <blockquote>
  <p>cannot convert from 'Discord.Embed' to
  System.Collections.Generic.IEnumerable&lt;Discord.Embed&gt;</p>
  </blockquote>
  <p>I tried this code and had the error fixed</p>
  <pre class="lang-cs prettyprint-override"><code>await client.SendFileAsync(filePath: &quot;file.txt&quot;, text: null, embeds: (IEnumerable&lt;Embed&gt;)eb);
  </code></pre>
  <p>I built and ran the .exe file and an error occured on console</p>
  <blockquote>
  <p>Unhandled Exception: System.InvalidCastException: Unable to cast
  object of type 'Discord.EmbedBuilder' to type
  System.Collections.Generic.IEnumerable 1[Discord.Embed].</p>
  </blockquote>
  <p>references:
  <a href="https://stackoverflow.com/questions/59398782/send-a-discord-embed-via-webhook-c-sharp">Send a Discord Embed via Webhook C#</a></p>
  <p><a href="https://stackoverflow.com/questions/44300770/discord-net-bot-embed-message">Discord.net bot Embed Message</a></p>
  <p><a href="https://stackoverflow.com/questions/47672300/modifyasync-not-working">ModifyAsync Not Working</a></p>
  <p><a href="https://discord.foxbot.me/docs/api/Discord.EmbedBuilder.html" rel="nofollow noreferrer">https://discord.foxbot.me/docs/api/Discord.EmbedBuilder.html</a></p>
  <p>I know most solutions above work but not in my case.
  I would really appreciate examples on how to solve this. thanks!</p>