Use the walrus instead of a for loop
parent
5c0b30cb15
commit
cb28f86038
|
@ -25,10 +25,7 @@ async def _(event):
|
|||
reply = cache.get(message, -1)
|
||||
if reply == -1:
|
||||
reply = None
|
||||
async for m in borg.iter_messages(
|
||||
event.chat_id,
|
||||
ids=message
|
||||
):
|
||||
if m := await borg.get_messages(event.chat_id, ids=message):
|
||||
reply = m.reply_to_msg_id
|
||||
cache[message] = reply
|
||||
if len(cache) % 10 == 0:
|
||||
|
|
Reference in New Issue