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

ひとつの投稿に対してbotが複数回反応してしまう場合がある #5

Open
attache-case opened this issue Jul 6, 2017 · 0 comments

Comments

@attache-case
Copy link
Owner

attache-case commented Jul 6, 2017

my_mention.pyにて、文頭の「おもいつき」に相当する何パターンかの文字列にbotが反応するように

@listen_to(r'^【おもいつき】.')
@listen_to(r'^おもいつき\s+\S.
')
@listen_to(r'^【思いつき】.')
@listen_to(r'^思いつき\s+\S.
')
@listen_to(r'^【思い付き】.')
@listen_to(r'^思い付き\s+\S.
')

というような書き方をしているため、例えば

おもいつき パース文字列の多様化
【思い付き】もパースされるようにしてほしい。
いろんな書き方をする人がいると思うので。

という投稿に対して、「おもいつき 」と「【思い付き】」それぞれ文頭にあるので、botが2回listen_func()を実行してしまい、
タイトル「パース文字列の多様化」
本文「【思い付き】もパースされるようにしてほしい。いろんな書き方をする人がいると思うので。」
というGitHubへの投稿も2回なされてしまう。

パースの仕方に問題がありそうなので、Issue #2 で扱っている「正規表現の簡略化」と合わせて解決したい。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant