我想通过嵌入消息将以下代码发送到 Discord Webhook:
var builder = new EmbedBuilder();
builder.WithTitle("Ice Wizard Stats");
builder.AddField("Hit Speed", "1.5sec", true); // True for inline
builder.WithThumbnailUrl("https://i.ibb.co/rc66Lq8/logonew.png");
builder.WithColor(Color.Red);
我该如何发送那个?
public class dWebHook: IDisposable
{
private readonly WebClient dWebClient;
private static NameValueCollection discord = new NameValueCollection();
public string WebHook { get; set;}
public string UserName { get; set; }
public string ProfilePicture { get; set;}
public dWebHook()
{
dWebClient = new WebClient();
}
public void SendMessage(string msgSend)
{
discord.Add("username", UserName);
discord.Add("avatar_url", ProfilePicture);
discord.Add("content", msgSend);
dWebClient.UploadValues(WebHook, discord);
}
public void Dispose()
{
dWebClient.Dispose();
}
我想这就是你正在寻找的
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)