utils Module¶
utils
Module¶
-
utils.
all_possible_beards
(paths)[source]¶ List generator of all plug-ins that Skybeard has found and can be loaded
-
utils.
get_args
(msg_or_text, return_string=False, **kwargs)[source]¶ Helper function when the command used in the telegram chat may have arguments, e.g /command arg1 arg2. Returns a list of any arguments found after the command
-
utils.
get_beard_config
(config_file='../../config.yml')[source]¶ Attempts to load a yaml file in the beard directory.
NOTE: The file location should be relative from where this function is called.
-
utils.
get_literal_path
(path_or_autoloader)[source]¶ Gets literal path from AutoLoader or returns input.
-
utils.
partition_text
(text)[source]¶ Generator for splitting long texts into ones below the character limit. Messages are split at the nearest line break and each successive chunk is yielded. Relatively untested
-
utils.
setup_beard
(beard_module_name, *, beard_python_path='python', beard_requirements_file='requirements.txt', config_file='config.yml', example_config_file='config.yml.example', copy_config=False)[source]¶ Sets up a beard for use.
Note: beard_python_path must be a path relative to the file setup_beard is called from.