난 정말 최고야 멋있어
cpprestsdk 를 이용해서 디스코드 봇 메세지 보내기 본문
#include <cpprest/http_client.h>
#include <cpprest/filestream.h>
#define cout wcout
#define WEBHOOK *웹훅주소*
void executeWebHook(wstring content)
{
using namespace std;
using namespace web::http;
using namespace web::http::client;
http_client client(WEBHOOK);
http_request req(methods::POST);
#pragma region payload
wstring boundary = L"----IMSOSEXYGUYYEAHEYAHEYAHEYAH";
wstring payload = L"--" + boundary + L"\r\n" +
L"Content-Disposition: form-data; name=\"content\";\r\n" +
L"Content-Type: text/Plain\r\n\r\n" +
content + L"\r\n" +
L"--" + boundary + L"--";
#pragma endregion
req.set_body(payload, L"multipart/form-data;boundary="+boundary);
client.request(req).then([](http_response res) {
if (res.status_code()/100 == 2)
{
cout << L"[+] successfully sended msg!" << endl;
}
else {
cout << res.to_string() << endl;
}
}).wait();
return;
}
ㅋㅋ MIME 띄어쓰기 못하면 안댐;;