⚙ Utils¶
Cache¶
Human Datetime Utils¶
- class GoldyBot.utils.human_datetime.HumanDatetimeOptions(value)[source]¶
Bases:
Enum
An enumeration.
- BOTH = 2¶
- DATE = 1¶
- TIME = 0¶
- GoldyBot.utils.human_datetime.get_datetime(human_time: str, option: Literal[HumanDatetimeOptions.TIME, 0], time_formats=['%H:%M']) datetime | None [source]¶
- GoldyBot.utils.human_datetime.get_datetime(human_date: str, option: Literal[HumanDatetimeOptions.DATE, 1], date_formats=['%d/%m/%Y', '%Y/%m/%d']) datetime | None
- GoldyBot.utils.human_datetime.get_datetime(human_datetime: str, option: Literal[HumanDatetimeOptions.BOTH, 2], datetime_formats=['%d/%m/%Y %H:%M', '%Y/%m/%d %H:%M', '%d.%m.%Y %H:%M', '%Y.%m.%d %H:%M']) datetime | None
A Goldy Bot utils function that can read human time and date and convert them to a datetime object.
Returns None if the human datetime string can’t be recognized.
String Utils¶
- GoldyBot.utils.strings.line_fix(string: str) str [source]¶
Fixes this -> https://github.com/Goldy-Bot/Goldy-Bot-V5/issues/37