.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"
|
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]... |
|
""" |
userbot/userbot/utils.py
Lines 109 to 117 in 4bfb02f