mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Fix #117: TypeError with LazyProxy object in keyboards
This commit is contained in:
parent
f228329b01
commit
25bdb9cf4d
2 changed files with 8 additions and 0 deletions
|
|
@ -1,6 +1,8 @@
|
|||
import datetime
|
||||
import secrets
|
||||
|
||||
from babel.support import LazyProxy
|
||||
|
||||
from aiogram import types
|
||||
from . import json
|
||||
|
||||
|
|
@ -57,6 +59,8 @@ def prepare_arg(value):
|
|||
return int((now + value).timestamp())
|
||||
elif isinstance(value, datetime.datetime):
|
||||
return round(value.timestamp())
|
||||
elif isinstance(value, LazyProxy):
|
||||
return str(value)
|
||||
return value
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue