Utils
General helper functions used by bot commands
Generic utility functions for Compass Bot
URL
Bases: str
URL substring checking class
If URL contains "substring", equality returns True. For example: URL("https://www.youtube.com/watch?v=1234567890") == "youtube" => True
ddict
check_time_format
Check that datetime input is in format YYYY-MM-DD HH:MM AM/PM TZ
chunk_list
download
async
dt_to_epoch
Convert datetime to epoch time (requires format: YYYY-MM-DD HH:MM AM/PM TZ
)
epoch_to_dt
Convert epoch time to datetime
extract_url
Extracts URL from message content, or returns as is
get_resource_path
get_resource_repo
Clone or pull resource repo
getfilepath
Returns filepath with guild-specific download prefix
Parameters:
Name | Type | Description | Default |
---|---|---|---|
itx
|
Message
|
Message context |
required |
fp
|
str
|
File path |
required |
parse_args
Parse arguments from a string into a dictionary