From 04bf4190768fedda6bd4a2ef56b0d916746edb4f Mon Sep 17 00:00:00 2001 From: Sergeydmitr Date: Wed, 11 Dec 2024 21:19:37 +0300 Subject: [PATCH] Added file_ids handling for incoming messages (#558) * Added file_ids handling for incoming messages * Update mattermostautodriver requirement from ~=1.3.0 to ~=2.0.0 (#464) * Update mattermostautodriver requirement from ~=1.3.0 to ~=2.0.0 Updates the requirements on [mattermostautodriver](https://github.com/embl-bio-it/python-mattermost-autodriver) to permit the latest version. - [Changelog](https://github.com/embl-bio-it/python-mattermost-autodriver/blob/main/CHANGELOG.rst) - [Commits](https://github.com/embl-bio-it/python-mattermost-autodriver/compare/1.3.0...2.0.0) --- updated-dependencies: - dependency-name: mattermostautodriver dependency-type: direct:production ... Signed-off-by: dependabot[bot] * Update requirements.txt * Update requirements.txt * Update requirements.txt --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Alex Tzonkov <4975715+attzonko@users.noreply.github.com> * Added file_ids handling for incoming messages --------- Signed-off-by: dependabot[bot] Co-authored-by: Sergey Dmitrenko Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Alex Tzonkov <4975715+attzonko@users.noreply.github.com> --- mmpy_bot/wrappers.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mmpy_bot/wrappers.py b/mmpy_bot/wrappers.py index 7a66bac7..58a459ee 100644 --- a/mmpy_bot/wrappers.py +++ b/mmpy_bot/wrappers.py @@ -38,6 +38,10 @@ def channel_id(self): def channel_name(self): return self.body["data"]["channel_name"] + @cached_property + def file_ids(self): + return self.body["data"]["post"].get("file_ids", []) + @cached_property def is_direct_message(self): return self.body["data"]["channel_type"] == "D"