Add type hints for config items

This commit is contained in:
Richard Chien
2018-10-14 20:32:00 +08:00
parent e59a81858d
commit bc0d7aaa64
4 changed files with 24 additions and 18 deletions

View File

@ -247,7 +247,8 @@ class CommandSession(BaseSession):
@property
def is_valid(self) -> bool:
"""Check if the session is expired or not."""
if self._last_interaction and \
if self.bot.config.SESSION_EXPIRE_TIMEOUT and \
self._last_interaction and \
datetime.now() - self._last_interaction > \
self.bot.config.SESSION_EXPIRE_TIMEOUT:
return False