mirror of
https://github.com/TeamPGM/pyrogram.git
synced 2024-11-23 23:34:28 +00:00
Maintain a sorted list of stored_msg_ids
This commit is contained in:
parent
cd027b8c1c
commit
bc420da0e2
@ -16,6 +16,7 @@
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import bisect
|
||||
from hashlib import sha256
|
||||
from io import BytesIO
|
||||
from os import urandom
|
||||
@ -118,6 +119,6 @@ def unpack(
|
||||
if time_diff < -300:
|
||||
return None
|
||||
|
||||
stored_msg_ids.append(message.msg_id)
|
||||
bisect.insort(stored_msg_ids, message.msg_id)
|
||||
|
||||
return message
|
||||
|
Loading…
Reference in New Issue
Block a user