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

Add script thank hubot #1

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from 2 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
5 changes: 5 additions & 0 deletions scripts/ping.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,8 @@ module.exports = (robot) ->
msg.send "Goodbye, cruel world."
process.exit 0

robot.respond /THANK YOU$/i, (msg) ->
msg.send "You're welcome."

robot.respond /ありがとう$/i, (msg) ->

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

最後に$を付けずに、/ありがとう/iにしたほうが「ありがとう!」とかにも対応できて良いと思いました〜。

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

私も @upinetree さんと同じコト考えてましたw
/ありがと(?:.*)/ とかにしたら、「ありがと♡」に返事してくれるのが、なんか親しみが出そう…みたいな ☺️

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ゆかおさんに書いて頂いた正規表現(ですよね?)の(?:)の部分が調べてもよく分からず、
(.*)にしてしまいました:baby_chick:
(考えてみたら、push する前に聞けば良かったですね:scream:)

(.*)との違いがあれば教えて頂けますとありがたいです:bow::bow:

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

idobataでtalktomeさんに(?:)の部分は最初に一致したものだけを扱うためのものと
教えて頂きましたので、ファイルの修正を行いました。

msg.send "どういたしまして"