Debian Codegraph @

docpages/example_programs/misc/collect_reactions.md

raw
1 \page collecting-reactions Collecting Reactions
2
3 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.
4
5 In the example below, we will use it to collect all reactions on a message.
6
7 \include{cpp} collect_reactions.cpp
8