1212#include " tgbot/types/PollAnswer.h"
1313#include " tgbot/types/ChatMemberUpdated.h"
1414#include " tgbot/types/ChatJoinRequest.h"
15+ #include " tgbot/types/MessageReactionUpdated.h"
16+ #include " tgbot/types/MessageReactionCountUpdated.h"
1517#include " tgbot/types/SuccessfulPayment.h"
1618
1719#include < functional>
@@ -44,6 +46,8 @@ friend EventHandler;
4446 typedef std::function<void (const PollAnswer::Ptr)> PollAnswerListener;
4547 typedef std::function<void (const ChatMemberUpdated::Ptr)> ChatMemberUpdatedListener;
4648 typedef std::function<void (const ChatJoinRequest::Ptr)> ChatJoinRequestListener;
49+ typedef std::function<void (const MessageReactionUpdated::Ptr)> MessageReactionUpdatedListener;
50+ typedef std::function<void (const MessageReactionCountUpdated::Ptr)> MessageReactionCountUpdatedListener;
4751 typedef std::function<void (const Message::Ptr, const SuccessfulPayment::Ptr)> SuccessfulPaymentListener;
4852
4953 /* *
@@ -204,6 +208,22 @@ friend EventHandler;
204208 _onChatJoinRequestListeners.push_back (listener);
205209 }
206210
211+ /* *
212+ * @brief Registers listener which receives new incoming message reaction update event.
213+ * @param listener Listener.
214+ */
215+ inline void onMessageReaction (const MessageReactionUpdatedListener& listener) {
216+ _onMessageReactionUpdatedListener.push_back (listener);
217+ }
218+
219+ /* *
220+ * @brief Registers listener which receives new incoming message reaction count update event.
221+ * @param listener Listener.
222+ */
223+ inline void onMessageReactionCount (const MessageReactionCountUpdatedListener& listener) {
224+ _onMessageReactionCountUpdatedListener.push_back (listener);
225+ }
226+
207227 /* *
208228 * @brief Registers listener which receives information about successful payments.
209229 * This listener is triggered when a successful payment is received by the bot.
@@ -293,6 +313,14 @@ friend EventHandler;
293313 broadcast<ChatJoinRequestListener, ChatJoinRequest::Ptr>(_onChatJoinRequestListeners, result);
294314 }
295315
316+ inline void broadcastMessageReactionUpdated (const MessageReactionUpdated::Ptr& messageReaction) const {
317+ broadcast<MessageReactionUpdatedListener, MessageReactionUpdated::Ptr>(_onMessageReactionUpdatedListener, messageReaction);
318+ }
319+
320+ inline void broadcastMessageReactionCountUpdated (const MessageReactionCountUpdated::Ptr& messageReactionCount) const {
321+ broadcast<MessageReactionCountUpdatedListener, MessageReactionCountUpdated::Ptr>(_onMessageReactionCountUpdatedListener, messageReactionCount);
322+ }
323+
296324 inline void broadcastSuccessfulPayment (const Message::Ptr& message) const {
297325 if (!message || !message->successfulPayment ) {
298326 return ;
@@ -318,6 +346,8 @@ friend EventHandler;
318346 std::vector<ChatMemberUpdatedListener> _onMyChatMemberListeners;
319347 std::vector<ChatMemberUpdatedListener> _onChatMemberListeners;
320348 std::vector<ChatJoinRequestListener> _onChatJoinRequestListeners;
349+ std::vector<MessageReactionUpdatedListener> _onMessageReactionUpdatedListener;
350+ std::vector<MessageReactionCountUpdatedListener> _onMessageReactionCountUpdatedListener;
321351 std::vector<SuccessfulPaymentListener> _onSuccessfulPaymentListeners;
322352
323353};
0 commit comments