From ab0e1c89ef183b7fb221672835ea6ff89af09877 Mon Sep 17 00:00:00 2001 From: Masaya Suzuki <15100604+massongit@users.noreply.github.com> Date: Mon, 28 Nov 2022 23:15:11 +0900 Subject: [PATCH 1/2] =?UTF-8?q?textlint=E3=82=B3=E3=83=9E=E3=83=B3?= =?UTF-8?q?=E3=83=89=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/hato.py | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/hato.py b/plugins/hato.py index 25e1f62cdd..d3fa2f7f38 100644 --- a/plugins/hato.py +++ b/plugins/hato.py @@ -104,6 +104,7 @@ def earth_quake(): return msg +@action("textlint") def textlint(text: str): """文章を校正する""" From 6854813ca7efafd546338a88f7169b3c51480b59 Mon Sep 17 00:00:00 2001 From: "masaya.suzuki" Date: Mon, 28 Nov 2022 23:41:05 +0900 Subject: [PATCH 2/2] =?UTF-8?q?=E3=83=87=E3=82=B3=E3=83=AC=E3=83=BC?= =?UTF-8?q?=E3=82=BF=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/analyze.py | 2 +- plugins/hato.py | 13 +++++-------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/plugins/analyze.py b/plugins/analyze.py index 1e9447750e..d23af062b5 100644 --- a/plugins/analyze.py +++ b/plugins/analyze.py @@ -16,7 +16,7 @@ def analyze_message(message: str) -> Callable[[BaseClient], None]: "help": lambda m: hato.help_message, "eq": lambda m: hato.earth_quake, "地震": lambda m: hato.earth_quake, - "textlint": lambda m: hato.textlint(m[len("textlint ") :]), + "textlint": lambda m: partial(hato.textlint, text=m[len("textlint ") :]), "text list": lambda m: hato.get_text_list, "text add ": lambda m: partial(hato.add_text, word=m[len("text add ") :]), "text show ": lambda m: partial( diff --git a/plugins/hato.py b/plugins/hato.py index d3fa2f7f38..43bdda7bfc 100644 --- a/plugins/hato.py +++ b/plugins/hato.py @@ -108,16 +108,13 @@ def earth_quake(): def textlint(text: str): """文章を校正する""" - def ret(client: BaseClient): - msg = "完璧な文章っぽ!" - res = get_textlint_result(text) + msg = "完璧な文章っぽ!" + res = get_textlint_result(text) - if res: - msg = "文章の修正点をリストアップしたっぽ!\n" + res + if res: + msg = "文章の修正点をリストアップしたっぽ!\n" + res - client.post(msg) - - return ret + return msg @action("text list")