| 1 | #include <dpp/dpp.h> |
| 2 | |
| 3 | int main() { |
| 4 | /* Create the bot */ |
| 5 | dpp::cluster bot("token"); |
| 6 | |
| 7 | bot.on_log(dpp::utility::cout_logger()); |
| 8 | |
| 9 | bot.on_ready([&bot](const dpp::ready_t& event) { |
| 10 | /* Create a timer when the bot starts. */ |
| 11 | bot.start_timer([&bot](const dpp::timer& timer) { |
| 12 | /* Create a timer when the bot starts. */ |
| 13 | bot.request("https://dpp.dev/DPP-Logo.png", dpp::m_get, [&bot, timer](const dpp::http_request_completion_t& callback) { |
| 14 | /* Create a message to our desired channel, with the D++ logo. */ |
| 15 | bot.message_create(dpp::message(1140010849432522843, "").add_file("image.png", callback.body)); |
| 16 | /* Stop the timer by passing the timer handle in. */ |
| 17 | bot.stop_timer(timer); |
| 18 | }); |
| 19 | }, 10); /* Do it every 10 seconds. Timers also start with this delay. */ |
| 20 | }); |
| 21 | |
| 22 | bot.start(dpp::st_wait); |
| 23 | } |
nothing calls this directly
no test coverage detected