more refactoring

This commit is contained in:
Syping 2024-02-04 10:03:18 +01:00
parent b09da9cfce
commit 7e3696ce90
5 changed files with 47 additions and 32 deletions

View file

@ -79,7 +79,7 @@ void bot::webhook_push::push_request(dpp::snowflake webhook_id, const std::strin
std::future<dpp::http_request_completion_t> _f = _p.get_future();
bot->post_rest(API_PATH "/webhooks", std::to_string(webhook_id), dpp::utility::url_encode(webhook_token), dpp::m_post, json, [bot, &_p](dpp::json &json, const dpp::http_request_completion_t &event) {
if (event.status != 204)
std::cerr << "[dtranslatebot] Warning: Webhook push returned unexpected code " << event.status << std::endl;
std::cerr << "[dtranslatebot] [WARNING] Webhook push returned unexpected code " << event.status << std::endl;
_p.set_value(event);
});
_f.wait();