diff --git a/mattermost/__init__.py b/mattermost/__init__.py index 8f8bf5d..209c8ee 100644 --- a/mattermost/__init__.py +++ b/mattermost/__init__.py @@ -1072,7 +1072,7 @@ def get_channels_for_user(self, user_id, team_id, **kwargs): #+ **POSTS** - def create_post(self, channel_id, message, props=None, filepaths=None, root_id=None, **kwargs): + def create_post(self, channel_id, message, props=None, filepaths=None, root_id=None, metadata=None, **kwargs): """ Create a new post in a channel. To create the post as a comment on another post, provide root_id. @@ -1082,6 +1082,7 @@ def create_post(self, channel_id, message, props=None, filepaths=None, root_id=N props (string, optional): see MM-API docs. filepaths (list, optional): Paths to upload files from and attach to post. root_id (string, optional): see MM-API docs. + metadata (dict, optional): Priority metadata. see MM-API docs. Returns: dict: created Post. @@ -1098,12 +1099,12 @@ def create_post(self, channel_id, message, props=None, filepaths=None, root_id=N "channel_id": channel_id, "message": message, **({"props": props} if props else {"props": {"from_webhook":"true"}}), + **({"metadata": metadata} if metadata else {"metadata": {}}), "root_id":root_id, "file_ids": file_ids, }, **kwargs) - def create_ephemeral_post(self, channel_id, message, user_id, **kwargs): """ Create a new ephemeral post in a channel.