| 39 | } |
| 40 | |
| 41 | commandhandler::commandhandler(cluster* o, bool auto_hook_events, snowflake application_id) : slash_commands_enabled(false), owner(o), app_id(application_id) |
| 42 | { |
| 43 | if (!application_id && o->me.id) { |
| 44 | app_id = o->me.id; |
| 45 | } |
| 46 | if (auto_hook_events) { |
| 47 | interactions = o->on_slashcommand([this](const dpp::slashcommand_t &event) { |
| 48 | this->route(event); |
| 49 | }); |
| 50 | messages = o->on_message_create([this](const dpp::message_create_t & event) { |
| 51 | this->route(event); |
| 52 | }); |
| 53 | } else { |
| 54 | interactions = messages = 0; |
| 55 | } |
| 56 | |
| 57 | } |
| 58 | |
| 59 | commandhandler& commandhandler::set_owner(cluster* o) |
| 60 | { |