| 1 | #include <dpp/dpp.h> |
| 2 | #include <dpp/unicode_emoji.h> |
| 3 | |
| 4 | int main() { |
| 5 | dpp::cluster bot("Epic Token"); |
| 6 | |
| 7 | bot.on_log(dpp::utility::cout_logger()); |
| 8 | |
| 9 | /* We'll be using two emojis: shocked guy and animated mad face. */ |
| 10 | dpp::emoji shocked("vahuyi", 1179366531856093214); |
| 11 | dpp::emoji mad("mad", 1117795317052616704, dpp::e_animated); /* We need this third argument, which is an emoji flag. */ |
| 12 | |
| 13 | bot.on_slashcommand([shocked, mad](const dpp::slashcommand_t& event) { |
| 14 | if (event.command.get_command_name() == "send-emojis") { |
| 15 | /* Here we send our very informative message: three epic emojis. */ |
| 16 | event.reply(dpp::unicode_emoji::nerd + shocked.get_mention() + mad.get_mention()); |
| 17 | } |
| 18 | }); |
| 19 | |
| 20 | bot.on_ready([&bot](const dpp::ready_t& event) { |
| 21 | if (dpp::run_once<struct register_bot_commands>()) { |
| 22 | bot.global_command_create(dpp::slashcommand("send-emojis", "Send the emojis", bot.me.id)); |
| 23 | } |
| 24 | }); |
| 25 | |
| 26 | /* Start the bot! */ |
| 27 | bot.start(dpp::st_wait); |
| 28 | return 0; |
| 29 | } |