Fix #117: TypeError with LazyProxy object in keyboards

This commit is contained in:
Alex RootJunior 2019-04-07 14:13:54 +03:00
parent f228329b01
commit 25bdb9cf4d
2 changed files with 8 additions and 0 deletions

View file

@ -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