1
0
mirror of https://github.com/danog/MadelineProto.git synced 2024-11-27 06:34:41 +01:00

Fix: immortal cache of sponsored messages

This commit is contained in:
Alexander Pankratov 2022-01-01 22:49:33 +03:00
parent 7fdc43f08f
commit a05e11c1ff

View File

@ -41,7 +41,7 @@ trait Ads
{
$peer = (yield from $this->getInfo($peer))['bot_api_id'];
$cache = yield $this->sponsoredMessages[$peer];
if ($cache && $cache[0] < \time()) {
if ($cache && $cache[0] > \time()) {
return $cache[1];
}
$result = (yield from $this->methodCallAsyncRead('channels.getSponsoredMessages', ['channel' => $peer]))['messages'];