merge file by feature
This commit is contained in:
parent
575979c497
commit
5cf17d64f9
@ -50,3 +50,21 @@ void on_message(dpp::cluster& bot)
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void on_react(dpp::cluster& bot)
|
||||||
|
{
|
||||||
|
bot.on_message_reaction_add([&bot](const dpp::message_reaction_add_t& event)
|
||||||
|
{
|
||||||
|
dpp::channel channel = bot.channel_get_sync(event.channel_id);
|
||||||
|
dpp::channel category = bot.channel_get_sync(channel.parent_id);
|
||||||
|
|
||||||
|
if (category.is_category() == false || category.name != GROCERY_LIST_CATEGORY)
|
||||||
|
return;
|
||||||
|
|
||||||
|
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);
|
||||||
|
});
|
||||||
|
}
|
@ -1,23 +0,0 @@
|
|||||||
#include <dpp/cluster.h>
|
|
||||||
#include <dpp/unicode_emoji.h>
|
|
||||||
#include <dpp/dpp.h>
|
|
||||||
|
|
||||||
#include "config.h"
|
|
||||||
|
|
||||||
void on_react(dpp::cluster& bot)
|
|
||||||
{
|
|
||||||
bot.on_message_reaction_add([&bot](const dpp::message_reaction_add_t& event)
|
|
||||||
{
|
|
||||||
dpp::channel channel = bot.channel_get_sync(event.channel_id);
|
|
||||||
dpp::channel category = bot.channel_get_sync(channel.parent_id);
|
|
||||||
|
|
||||||
if (category.is_category() == false || category.name != GROCERY_LIST_CATEGORY)
|
|
||||||
return;
|
|
||||||
|
|
||||||
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);
|
|
||||||
});
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user