Module slack_sdk.web.internal_utils

Functions

def convert_bool_to_0_or_1(params: Optional[Dict[str, Any]]) ‑> Optional[Dict[str, Any]]

Converts all bool values in dict to "0" or "1".

Slack APIs safely accept "0"/"1" as boolean values. Using True/False (bool in Python) doesn't work with aiohttp. This method converts only the bool values in top-level of a given dict.

Args

params
params as a dict

Returns

Modified dict

def get_user_agent(prefix: Optional[str] = None, suffix: Optional[str] = None)

Construct the user-agent header with the package info, Python version and OS version.

Returns

The user agent string. e.g. 'Python/3.6.7 slackclient/2.0.0 Darwin/17.7.0'