mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-01 15:37:19 +00:00
fix: send slack message failed
This commit is contained in:
@@ -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:
|
||||||
|
Reference in New Issue
Block a user