Switched from update_id to message_id.
This commit is contained in:
parent
ed510c0635
commit
a6816bd213
12
F1DataBot.pm
12
F1DataBot.pm
@ -38,7 +38,7 @@ sub new {
|
|||||||
};
|
};
|
||||||
|
|
||||||
# load remembered update ids
|
# load remembered update ids
|
||||||
$Self->{UpdateIDs} = YAML::LoadFile('update_ids.yml');
|
$Self->{MessageIDs} = YAML::LoadFile('message_ids.yml');
|
||||||
|
|
||||||
return $Self;
|
return $Self;
|
||||||
}
|
}
|
||||||
@ -393,17 +393,17 @@ sub fetchMessages {
|
|||||||
|
|
||||||
MESSAGE:
|
MESSAGE:
|
||||||
for my $Message (@Messages) {
|
for my $Message (@Messages) {
|
||||||
$Self->{LogObject}->info('fetchMessages: Calling processMessage');
|
if ($Self->{MessageIDs}{$Message->{message}{message_id}}) {
|
||||||
if ($Self->{UpdateIDs}{$Message->{update_id}}) {
|
$Self->{LogObject}->info('fetchMessages: Skipping known message_id');
|
||||||
$Self->{LogObject}->info('fetchMessages: Skipping known update_id');
|
|
||||||
next MESSAGE;
|
next MESSAGE;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$Self->{UpdateIDs}{$Message->{update_id}} = 1;
|
$Self->{LogObject}->info('fetchMessages: Calling processMessage');
|
||||||
|
$Self->{MessageIDs}{$Message->{message}{message_id}} = 1;
|
||||||
$Self->processMessage( Message => $Message, );
|
$Self->processMessage( Message => $Message, );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
YAML::DumpFile('update_ids.yml', $Self->{UpdateIDs});
|
YAML::DumpFile('message_ids.yml', $Self->{MessageIDs});
|
||||||
}
|
}
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
Loading…
Reference in New Issue
Block a user