Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

textlintコマンド修正 #1971

Merged
merged 3 commits into from
Nov 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion plugins/analyze.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
14 changes: 6 additions & 8 deletions plugins/hato.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,19 +104,17 @@ def earth_quake():
return msg


@action("textlint")
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")
Expand Down