Add /remind backup and /remind restore commands

This commit is contained in:
2025-01-18 23:50:27 +01:00
parent 4b3acc0948
commit 07297e5a56
3 changed files with 197 additions and 65 deletions

View File

@ -13,7 +13,7 @@ if TYPE_CHECKING:
logger: logging.Logger = logging.getLogger(__name__)
def calculate(job: Job) -> str:
def calculate(job: Job) -> str | None:
"""Calculate the time left for a job.
Args:
@ -28,7 +28,7 @@ def calculate(job: Job) -> str:
if trigger_time is None:
logger.error("Couldn't calculate time for job: %s: %s", job.id, job.name)
logger.error("State: %s", job.__getstate__() if hasattr(job, "__getstate__") else "No state")
return "Paused"
return None
return f"<t:{int(trigger_time.timestamp())}:R>"