Skip to content

Commit aeaa2e2

Browse files
authored
Merge pull request #1971 from dev-hato/massongit-patch-1
textlintコマンド修正
2 parents ea52599 + aa5b0a9 commit aeaa2e2

2 files changed

Lines changed: 7 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: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -104,19 +104,17 @@ def earth_quake():
104104
return msg
105105

106106

107+
@action("textlint")
107108
def textlint(text: str):
108109
"""文章を校正する"""
109110

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

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

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

121119

122120
@action("text list")

0 commit comments

Comments
 (0)