File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -248,7 +248,7 @@ bot.on('text', function(msg)
248248
249249 // console.log(msg);
250250
251- if ( msg . forward_date ) { // Skip All Forward Messages
251+ if ( msg . forward_date ) { // Skip All Forwarded Messages
252252 return ;
253253 }
254254
@@ -265,7 +265,9 @@ bot.on('text', function(msg)
265265 's_username' : messageUserName
266266 } ;
267267
268- globalStackListDigestMessages . push ( messageInfoStruct ) ;
268+ if ( ! isDuplicateMessage ( messageInfoStruct ) ) {
269+ globalStackListDigestMessages . push ( messageInfoStruct ) ;
270+ }
269271
270272 // Send message by bot.
271273 sendMessageByBot ( messageChatId ,
@@ -1047,6 +1049,18 @@ function addYourStringToString(aYourString, aString)
10471049 return aYourString + aString ;
10481050}
10491051
1052+ function isDuplicateMessage ( aMessage )
1053+ {
1054+ for ( var i = 0 ; i < globalStackListDigestMessages . length ; ++ i ) {
1055+ if ( aMessage . s_message === globalStackListDigestMessages [ i ] . s_message &&
1056+ aMessage . s_username === globalStackListDigestMessages [ i ] . s_username &&
1057+ aMessage . s_date === globalStackListDigestMessages [ i ] . s_date ) {
1058+ return true ;
1059+ }
1060+ }
1061+ return false ;
1062+ }
1063+
10501064// ----- CURRENCY SECTION
10511065function createReportCurrencyHeader ( aCatchPhrase )
10521066{
You can’t perform that action at this time.
0 commit comments