scrapinghub / slackbot

A chat bot for Slack (https://slack.com).
MIT License
1.26k stars 396 forks source link

Set plural strings for `@respond to` #147

Closed tomoharu-takagi closed 7 years ago

tomoharu-takagi commented 7 years ago

Hi ! I would like to know how to code plural strings for @respond to, because if my colleague enter a sentence included plural key strings, then I want to respond correct answer. For example, although, I image that@respond to ('aaa','bbb','ccc') : these three strings are combined AND operator, can I code slackbot like this ?

jtatum commented 7 years ago

@kingfisher66, can you clarify what @respond_to('aaa', 'bbb', 'ccc') would respond to? Would @bot aaa match, or would it have to be @bot aaa ccc bbb or ...?

tomoharu-takagi commented 7 years ago

@jtatum Thank you for your reply ! I wanted to write code to get a correct answer for a question sentence included plural keywords, and so I wrote the code that checked whether the question sentence included the plural keywords or not, with if statement ,AND operator and regular expression. I have resolved this problem. Thank you again !