MCPcopy Create free account
hub / github.com/brainboxdotcc/DPP / edit_webhook_message

Method edit_webhook_message

src/dpp/cluster/webhook.cpp:49–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47}
48
49void cluster::edit_webhook_message(const class webhook &wh, const struct message& m, snowflake thread_id, command_completion_event_t callback) {
50 std::string parameters = utility::make_url_parameters({
51 {"thread_id", thread_id},
52 });
53
54 this->post_rest_multipart(API_PATH "/webhooks", std::to_string(wh.id), utility::url_encode(!wh.token.empty() ? wh.token: token) + "/messages/" + std::to_string(m.id) + parameters, m_patch, m.build_json(false), [this, callback](json &j, const http_request_completion_t& http) {
55 if (callback) {
56 callback(confirmation_callback_t(this, message(this).fill_from_json(&j), http));
57 }
58 }, m.file_data);
59}
60
61void cluster::edit_webhook_with_token(const class webhook& wh, command_completion_event_t callback) {
62 json jwh = wh.to_json(true);

Callers

nothing calls this directly

Calls 9

post_rest_multipartMethod · 0.95
make_url_parametersFunction · 0.85
to_stringFunction · 0.85
url_encodeFunction · 0.85
callbackClass · 0.85
build_jsonMethod · 0.80
messageClass · 0.70
emptyMethod · 0.45

Tested by

no test coverage detected