diff --git a/src/main.cpp b/src/main.cpp index c5c488c..6cb339c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -14,7 +14,6 @@ int main() { if (event.msg.author.id == bot.me.id) { - bot.message_add_reaction(event.msg, dpp::unicode_emoji::x); bot.message_add_reaction(event.msg, dpp::unicode_emoji::white_check_mark); } else @@ -35,6 +34,15 @@ int main() } }); + bot.on_message_reaction_add([&bot](const dpp::message_reaction_add_t& event) + { + if (event.reacting_user.id == bot.me.id) + return; + dpp::emoji emoji = event.reacting_emoji; + if (emoji.name == dpp::unicode_emoji::white_check_mark) + bot.message_delete(event.message_id, event.channel_id); + }); + bot.on_ready([&bot](const dpp::ready_t& event) { std::cout << bot.me.id << std::endl;