@@ -246,9 +246,12 @@ private Set<MessageType> parseMessageType() {
246246 if (message .hasVoice ()) {
247247 types .add (MessageType .VOICE );
248248 }
249- if (message .getGame () != null ) {
249+ if (message .hasGame () ) {
250250 types .add (MessageType .GAME );
251251 }
252+ if (message .hasInvoice ()) {
253+ types .add (MessageType .INVOICE );
254+ }
252255 if (message .hasSuccessfulPayment ()) {
253256 types .add (MessageType .SUCCESSFUL_PAYMENT );
254257 }
@@ -261,8 +264,41 @@ private Set<MessageType> parseMessageType() {
261264 if (message .hasDice ()) {
262265 types .add (MessageType .DICE );
263266 }
267+ if (message .hasStory ()) {
268+ types .add (MessageType .STORY );
269+ }
270+ if (message .getExternalReplyInfo () != null ) {
271+ types .add (MessageType .EXTERNAL_REPLY_INFO );
272+ }
273+ if (message .getForwardOrigin () != null ) {
274+ types .add (MessageType .FORWARD_ORIGIN );
275+ }
276+ if (message .getQuote () != null ) {
277+ types .add (MessageType .QUOTE );
278+ }
279+ if (message .getGiveaway () != null ) {
280+ types .add (MessageType .GIVEAWAY );
281+ }
282+ if (message .getGiveawayWinners () != null ) {
283+ types .add (MessageType .GIVEAWAY_WINNERS );
284+ }
285+ if (message .hasReplyToStory ()) {
286+ types .add (MessageType .REPLY_TO_STORY );
287+ }
288+ if (message .hasBoostAdded ()) {
289+ types .add (MessageType .BOOST_ADDED );
290+ }
291+ if (message .hasPaidMedia ()) {
292+ types .add (MessageType .PAID_MEDIA );
293+ }
294+
264295 parseChatChanges (types );
265296 parseServiceMessage (types );
297+
298+ if (types .isEmpty ()) {
299+ types .add (MessageType .UNKNOWN );
300+ }
301+
266302 return types ;
267303 }
268304
@@ -274,7 +310,11 @@ private void parseServiceMessage(Set<MessageType> types) {
274310 message .getForumTopicCreated (), message .getForumTopicClosed (),
275311 message .getForumTopicReopened (), message .getForumTopicEdited (),
276312 message .getGeneralForumTopicHidden (), message .getGeneralForumTopicUnhidden (),
277- message .getWriteAccessAllowed (), message .getUserShared (), message .getChatShared ()
313+ message .getWriteAccessAllowed (), message .getUserShared (), message .getChatShared (),
314+ message .getGiveawayCreated (), message .getGiveawayCompleted (), message .getBoostAdded (),
315+ message .getChatBackgroundSet (), message .getRefundedPayment (), message .getGift (),
316+ message .getUniqueGift (), message .getPaidMessagePriceChanged ()
317+
278318 ) != null ) {
279319 types .add (MessageType .SERVICE_MESSAGE );
280320 }
0 commit comments