Skip to content

Commit 6854813

Browse files
committed
デコレータ対応
1 parent ab0e1c8 commit 6854813

2 files changed

Lines changed: 6 additions & 9 deletions

File tree

plugins/analyze.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def analyze_message(message: str) -> Callable[[BaseClient], None]:
1616
"help": lambda m: hato.help_message,
1717
"eq": lambda m: hato.earth_quake,
1818
"地震": lambda m: hato.earth_quake,
19-
"textlint": lambda m: hato.textlint(m[len("textlint ") :]),
19+
"textlint": lambda m: partial(hato.textlint, text=m[len("textlint ") :]),
2020
"text list": lambda m: hato.get_text_list,
2121
"text add ": lambda m: partial(hato.add_text, word=m[len("text add ") :]),
2222
"text show ": lambda m: partial(

plugins/hato.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -108,16 +108,13 @@ def earth_quake():
108108
def textlint(text: str):
109109
"""文章を校正する"""
110110

111-
def ret(client: BaseClient):
112-
msg = "完璧な文章っぽ!"
113-
res = get_textlint_result(text)
111+
msg = "完璧な文章っぽ!"
112+
res = get_textlint_result(text)
114113

115-
if res:
116-
msg = "文章の修正点をリストアップしたっぽ!\n" + res
114+
if res:
115+
msg = "文章の修正点をリストアップしたっぽ!\n" + res
117116

118-
client.post(msg)
119-
120-
return ret
117+
return msg
121118

122119

123120
@action("text list")

0 commit comments

Comments
 (0)