Notice
Recent Posts
Recent Comments
Link
«   2024/09   »
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30
Tags more
Archives
Today
Total
관리 메뉴

난 정말 최고야 멋있어

cpprestsdk 를 이용해서 디스코드 봇 메세지 보내기 본문

카테고리 없음

cpprestsdk 를 이용해서 디스코드 봇 메세지 보내기

n00bh4cker 2020. 3. 4. 15:04
#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 띄어쓰기 못하면 안댐;;