@@ -96,7 +96,7 @@ def _send_wecom(config: dict, title: str, content: str):
9696 agentid = config ['agentid' ]
9797 )
9898
99- message = f"{ title } \n { content } "
99+ message = title if not content or not content . strip () else f"{ title } \n { content } "
100100 result = wn .send_msg (message )
101101 return True
102102
@@ -106,7 +106,7 @@ def _send_wecom_webhook(config: dict, title: str, content: str):
106106 from ANotify import Nwecom
107107
108108 wn_webhook = Nwecom .WxWebhookNotify (config ['webhook_url' ])
109- message = f"{ title } \n { content } "
109+ message = title if not content or not content . strip () else f"{ title } \n { content } "
110110 result = wn_webhook .send_msg (message )
111111 return True
112112
@@ -121,7 +121,7 @@ def _send_feishu(config: dict, title: str, content: str):
121121 )
122122
123123 receiver_type = getattr (Nfeishu .ReceiverType , config ['receiver_type' ])
124- message = f"{ title } \n \n { content } "
124+ message = title if not content or not content . strip () else f"{ title } \n \n { content } "
125125 result = feishu .send_msg (receiver_type , config ['receiver_id' ], message )
126126 return True
127127
@@ -131,7 +131,7 @@ def _send_feishu_webhook(config: dict, title: str, content: str):
131131 from ANotify import Nfeishu
132132
133133 feishu_webhook = Nfeishu .FeishuWebhookNotify (config ['webhook_url' ])
134- message = f"{ title } \n \n { content } "
134+ message = title if not content or not content . strip () else f"{ title } \n \n { content } "
135135 result = feishu_webhook .send_msg (message )
136136 return True
137137
@@ -141,7 +141,7 @@ def _send_dingtalk_webhook(config: dict, title: str, content: str):
141141 from ANotify import Ndingtalk
142142
143143 dingtalk_webhook = Ndingtalk .DingtalkWebhookNotify (config ['webhook_url' ])
144- message = f"{ title } \n \n { content } "
144+ message = title if not content or not content . strip () else f"{ title } \n \n { content } "
145145 result = dingtalk_webhook .send_msg (message )
146146 return True
147147
0 commit comments