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,7 +424,8 @@ 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:
timescale = int(context.args[0])
today_start = datetime.combine(date.today(), datetime.min.time()) today_start = datetime.combine(date.today(), datetime.min.time())
start_date = today_start - timedelta(days=timescale) start_date = today_start - timedelta(days=timescale)
except (TypeError, ValueError, IndexError): except (TypeError, ValueError, IndexError):