#include #include #include #include #include #include #include #include #include #include #include #include using json = nlohmann::json; namespace dpp { namespace events { using namespace dpp; void thread_create::handle(discord_client* client, json& j, const std::string& raw) { json& d = j["d"]; dpp::channel t; t.fill_from_json(&d); dpp::guild* g = dpp::find_guild(t.guild_id); if (g) { g->threads.push_back(t.id); if (client->creator->dispatch.thread_create) { dpp::thread_create_t tc(client, raw); tc.created = t; tc.creating_guild = g; client->creator->dispatch.thread_create(tc); } } } }};