bug: status-bot implementation

This commit is contained in:
Nick Ninov
2026-08-18 08:36:27 +03:00
parent c526e9c842
commit b14de3bcab
3 changed files with 8 additions and 16 deletions
+1 -1
View File
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "status-sdk"
version = "1.1.1"
version = "1.1.2"
description = "Private chat. Communities. Multi-chain wallet. Browser. dApps all in one app, powered by SNT."
readme = "README.md"
requires-python = ">=3.11"
+4 -12
View File
@@ -1731,19 +1731,11 @@ class Account:
if not isinstance(timestamp, str):
raise exceptions.InvalidTimestampError(f"Expected a `str` or a `datetime.datetime`, got `{type(timestamp).__name__}`...")
# Accepted timestamp formats, tried from the most to the least precise
formats = [
"%Y-%m-%d %H:%M:%S.%f", "%Y-%m-%d %H:%M:%S",
"%Y-%m-%d %H:%M", "%Y-%m-%d %H", "%Y-%m-%d"
]
value = timestamp.strip().replace("T", " ")
for current_format in formats:
try:
return datetime.datetime.strptime(value, current_format)
except ValueError:
continue
try:
return datetime.datetime.fromisoformat(timestamp)
except:
raise exceptions.InvalidTimestampError(f"`{timestamp}` is not a valid timestamp... Please make sure the input is in ISO 8601 format (https://www.iso.org/iso-8601-date-and-time-format.html).")
raise exceptions.InvalidTimestampError(f"`{timestamp}` is not a valid timestamp. Supported formats: {', '.join(formats)}")
def __validate_display_name(self, name: str):
"""
+3 -3
View File
@@ -4,12 +4,12 @@ import logging
class Logger:
instance: Optional[logging.Logger] = None
def __new__(cls) -> logging.Logger:
def __new__(cls, name: str = "status-bot") -> logging.Logger:
if cls.instance:
return cls.instance
return logging.getLogger(name)
cls.instance = logging.getLogger("status-bot")
cls.instance = logging.getLogger(name)
cls.instance.setLevel(logging.INFO)
cls.instance.propagate = False