| 56 | } |
| 57 | |
| 58 | void cluster::guild_bulk_command_create(const std::vector<slashcommand> &commands, snowflake guild_id, command_completion_event_t callback) { |
| 59 | json j = json::array(); |
| 60 | for (auto & s : commands) { |
| 61 | j.push_back(s.to_json(false)); |
| 62 | } |
| 63 | rest_request_list<slashcommand>(this, API_PATH "/applications", std::to_string(commands.size() > 0 && commands[0].application_id ? commands[0].application_id : me.id), "guilds/" + std::to_string(guild_id) + "/commands", m_put, j.dump(-1, ' ', false, json::error_handler_t::replace), callback); |
| 64 | } |
| 65 | |
| 66 | void cluster::guild_bulk_command_delete(snowflake guild_id, command_completion_event_t callback) { |
| 67 | rest_request_list<slashcommand>(this, API_PATH "/applications", std::to_string(me.id), "guilds/" + std::to_string(guild_id) + "/commands", m_put, "{}", callback); |