day/week options for Telegram '/profit' command

mypy fix
This commit is contained in:
Eugene Schava 2021-05-28 17:18:23 +03:00
parent 012309a06a
commit 14df243661

View File

@ -424,9 +424,10 @@ class Telegram(RPCHandler):
start_date = datetime.fromtimestamp(0) start_date = datetime.fromtimestamp(0)
try: try:
timescale = int(context.args[0]) if context.args else None if context.args:
today_start = datetime.combine(date.today(), datetime.min.time()) timescale = int(context.args[0])
start_date = today_start - timedelta(days=timescale) today_start = datetime.combine(date.today(), datetime.min.time())
start_date = today_start - timedelta(days=timescale)
except (TypeError, ValueError, IndexError): except (TypeError, ValueError, IndexError):
pass pass