add: delete button

This commit is contained in:
starnakin 2023-10-07 23:21:42 +00:00
parent 73fc774be9
commit df5f8c3227

View File

@ -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;