Files
BumbleCee/DPP-master/docpages/example_programs/misc/collect_reactions.md
2023-12-20 19:45:25 +09:00

9 lines
541 B
Markdown

\page collecting-reactions Collecting Reactions
D++ comes with many useful helper classes, but amongst these is something called dpp::collector. Collector is a template which can be specialised to automatically collect objects of a predetermined type from events for a specific interval of time. Once this time period is up, or the class is otherwise signalled, a method is called with the complete set of collected objects.
In the example below, we will use it to collect all reactions on a message.
\include{cpp} collect_reactions.cpp