feat: 支持JSON格式的公告

This commit is contained in:
Rock Chin
2023-04-15 16:45:26 +08:00
parent d605de9de4
commit 7569b18a4c
3 changed files with 44 additions and 21 deletions

View File

@@ -303,8 +303,9 @@ def start(first_time_init=False):
try:
import pkg.utils.announcement as announcement
new_announcement = announcement.fetch_new()
if new_announcement != "":
logging.critical("[公告] {}".format(new_announcement))
if len(new_announcement) > 0:
for announcement in new_announcement:
logging.critical("[公告] {}".format(announcement))
except Exception as e:
logging.warning("获取公告失败:{}".format(e))