From 23aedb3a3e32c7dc9597fa11d67d976531388acc Mon Sep 17 00:00:00 2001 From: xtaodada Date: Fri, 3 Feb 2023 18:05:44 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20=E6=94=AF=E6=8C=81=E5=A4=9A?= =?UTF-8?q?=E4=BD=8D=E5=90=88=E4=BD=9C=E8=80=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- defs/msg.py | 3 ++- defs/utils.py | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/defs/msg.py b/defs/msg.py index c252e2e..9617ebb 100644 --- a/defs/msg.py +++ b/defs/msg.py @@ -48,7 +48,8 @@ def format_text(text: str) -> str: def gen_tags(data: Module) -> str: text = f"#{format_text(data.description.split()[0])} " if data.collaborators: - text += f"#{format_text(data.collaborators[0])} " + for i in data.collaborators: + text += f"#{format_text(i)} " return text diff --git a/defs/utils.py b/defs/utils.py index ce12951..786df30 100644 --- a/defs/utils.py +++ b/defs/utils.py @@ -41,10 +41,10 @@ class Module: self.createdAt: str = strf_time(data["createdAt"]) text = [] for i in data["collaborators"]: - if i["name"]: - text.append(i["name"]) + if i.get("name"): + text.append(i["name"].replace(" ", "_").replace(".", "_").replace("-", "_")) else: - text.append(i["login"]) + text.append(i["login"].replace(" ", "_").replace(".", "_").replace("-", "_")) self.collaborators: List[str] = text self.latestRelease: str = data.get("latestRelease", "") releases = []