Skip to content

Commit f4689bb

Browse files
committed
Remove conditional check for block key when sending message with slack.
1 parent 32fa23a commit f4689bb

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
2020
### Removed
2121
- Removed `check_latest_version` function.
2222
- Removed CircleCI from project in favour of using Github Actions.
23-
- Remove Python 3.7 & 3.8 from test matrix.
23+
- Removed Python 3.7 & 3.8 from test matrix.
24+
- Removed detection of 'block' key from _post_block_message() which was causing messages to be silently ignored.
2425

2526
## [2.2.0] 2021-11-27
2627
### Added

src/err-stackstorm/errst2lib/chat_adapters.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -399,13 +399,11 @@ def _post_block_message(self, whisper, message, target_id, extra):
399399
"""
400400
Reference: https://api.slack.com/methods/chat.postMessage
401401
"""
402-
if "blocks" in extra["slack"]:
403-
extra["slack"]["text"] = message
404-
extra["slack"]["channel"] = target_id
402+
extra["slack"]["text"] = message
403+
extra["slack"]["channel"] = target_id
405404

406-
LOG.debug(f"Sending Slack Block {extra['slack']}")
407-
408-
self.bot_plugin._bot.slack_web.api_call("chat.postMessage", data=extra["slack"])
405+
LOG.debug(f"Sending Slack Block {extra['slack']}")
406+
self.bot_plugin._bot.slack_web.api_call("chat.postMessage", data=extra["slack"])
409407

410408
def format_help(self, help_strings):
411409
help_text = ""

0 commit comments

Comments
 (0)