【发布时间】:2020-07-27 12:30:54
【问题描述】:
我正在尝试将 img、.dat 文件等添加到 Discord WebHook 消息。 (本地文件)。
这是我的代码;
内容部分:
string url = "webhook"
string mesaj "example";
NameValueCollection message = new NameValueCollection() {
{ "username", "Beko BOT" },
{ "avatar_url", "https://i.ibb.co/qrcrHP4/B-Kare.png"},
{ "content", mesaj }
};
Http.Post(url, message);
发送部分:
public class Http
{
public static byte[] Post(string uri, NameValueCollection pairs)
{
byte[] numArray;
using (WebClient webClient = new WebClient())
{
numArray = webClient.UploadValues(uri, pairs);
}
return numArray;
}
}
感谢您的帮助!
【问题讨论】:
标签: c# file discord embed attachment