Skip to content

Clear service messages for a period #14

Open
@evgfilim1

Description

.clearsvcs [period] — Clear service messages for a period.

period can be a timedelta (e.g. "1d3h") or a time string (e.g. "12:30" or "2022-12-31_23:59").
If period is not specified, assume "1d"

userbot/userbot/utils.py

Lines 109 to 117 in 4bfb02f

def parse_timespec(now: datetime, timespec: str) -> datetime:
"""Parse a time specification and return target datetime.
The time specification is a string of the form:
– HH:MM
– YYYY-MM-DD_HH:MM
– N[smhdwy]
– N[smhdwy]N[smhdwy]...
"""

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Projects

    • Status

      📋 Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions