I am looking to embed the following:
Using the Discord API. I have looked and the only resources I can find are for Python, Java, Ruby, etc.
But when using:
var embed = new Message.Embed(
{
Author =
{
Name = "Name",
Url = "www.url.com"
}
});
It comes back with the message:
And:
Not sure What I need to do to be able use the embed library. Just looking for some guidance on how this works
Edit:
When Using this I get no errors but when running the embed doesnt seem to build. It doesnt error. It just never builds the embed variable
var embed = new Message.Embed
{
Author =
{
Name = "Lawler",
Url = "www.twitch.tv/Lawler"
},
Title = "www.twitch.tv/Lawler",
Thumbnail =
{
ProxyUrl = "https://yt3.ggpht.com/-m-P7t2g-ecQ/AAAAAAAAAAI/AAAAAAAAAAA/YtS2YsD8-AM/s900-c-k-no-mo-rj-c0xffffff/photo.jpg",
Url = "www.twitch.tv/Lawler"
},
Description = "**Now Playing**\n" +
"Rocket League\n" +
"**Stream Title**\n" +
"Lawler RLCS Caster"
};
*Note: I am using Discord v 0.9.6
You can create an Embed Message like the following code (using the most recent version of Discord.Net):
var builder = new EmbedBuilder()
{
//Optional color
Color = Color.Green,
Description = "This is the description of the embed message"
};
Build a field inside the Embed Message:
builder.AddField(x =>
{
x.Name = Author.Name;
x.Value = Author.Url;
x.IsInline = false;
});
And reply to the same channel context:
//Use await if you're using an async Task to be completed.
await ReplyAsync("", false, builder.Build())
The code above should build an embed message, there are more options in the Discord.Net docs. Link: https://docs.stillu.cc/guides/introduction/intro.html
I hope you find this helpful.