From 87a6e18b396ca02551517ee7f1488d7899ee6d37 Mon Sep 17 00:00:00 2001 From: Tamas Kiss <kiss.tamas@kszk.bme.hu> Date: Mon, 24 Jun 2024 09:07:55 +0200 Subject: [PATCH] fix: "from_webhook" post prop explicitly set to False --- mattermost_matchmaker/matchmaking.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mattermost_matchmaker/matchmaking.py b/mattermost_matchmaker/matchmaking.py index bb5cc0e..1e2430f 100644 --- a/mattermost_matchmaker/matchmaking.py +++ b/mattermost_matchmaker/matchmaking.py @@ -4,6 +4,7 @@ import mattermost # type: ignore #pylint: disable=invalid-name +props = {"from_webhook": "false"} def random_nonrepeating_tuples(population: Iterable, n: int) -> Generator[tuple, None, None]: """ @@ -37,18 +38,18 @@ def matching_in_channel(client: mattermost.MMApi, channel_id: str, if len(members) < minimum_members: if too_few_message: - client.create_post(channel_id=channel_id, message=too_few_message) + client.create_post(channel_id=channel_id, message=too_few_message, props=props) return groups_created, left_out = make_matches_for_members(client, members, group_size) if group_hail: for group_id in groups_created: - client.create_post(channel_id=group_id, message=group_hail) + client.create_post(channel_id=group_id, message=group_hail, props=props) if left_out_message and left_out is not None: user_data = client.get_user(left_out) - client.create_post(channel_id=channel_id, message=left_out_message.format(user=user_data)) + client.create_post(channel_id=channel_id, message=left_out_message.format(user=user_data), props=props) def create_group(client: mattermost.MMApi, ids: Iterable[str]) -> str: -- GitLab