Browse Source

fix: send slack message failed

pull/13233/head
feng 6 months ago committed by Bryan
parent
commit
d4c1f93ef6
  1. 4
      apps/common/sdk/im/slack/__init__.py

4
apps/common/sdk/im/slack/__init__.py

@ -27,7 +27,7 @@ class SlackRenderer(mistune.HTMLRenderer):
def strong(self, text): def strong(self, text):
return '*' + text + '*' return '*' + text + '*'
def list(self, text, **kwargs): def list(self, text, *args, **kwargs):
lines = text.split('\n') lines = text.split('\n')
for i, line in enumerate(lines): for i, line in enumerate(lines):
if not line: if not line:
@ -128,7 +128,7 @@ class Slack:
def send_text(self, user_ids, msg_body): def send_text(self, user_ids, msg_body):
body = self.convert_to_markdown(msg_body) body = self.convert_to_markdown(msg_body)
logger.info(f'Slack send text: user_ids={user_ids} msg={body}') logger.info(f'Slack send text: user_ids={user_ids}')
for user_id in user_ids: for user_id in user_ids:
body['channel'] = user_id body['channel'] = user_id
try: try:

Loading…
Cancel
Save