add: delete button
This commit is contained in:
parent
73fc774be9
commit
df5f8c3227
10
src/main.cpp
10
src/main.cpp
@ -14,7 +14,6 @@ int main()
|
|||||||
{
|
{
|
||||||
if (event.msg.author.id == bot.me.id)
|
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);
|
bot.message_add_reaction(event.msg, dpp::unicode_emoji::white_check_mark);
|
||||||
}
|
}
|
||||||
else
|
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)
|
bot.on_ready([&bot](const dpp::ready_t& event)
|
||||||
{
|
{
|
||||||
std::cout << bot.me.id << std::endl;
|
std::cout << bot.me.id << std::endl;
|
||||||
|
Loading…
Reference in New Issue
Block a user