Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions mattermost/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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.
Expand All @@ -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.
Expand Down