Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

57 lines (48 sloc) 1.257 kB
# Description:
# Polite.
#
# Dependencies:
# None
#
# Configuration:
# None
#
# Commands:
#
# Author:
# dannymcc
responses = [
"You're welcome.",
"No problem.",
"Anytime.",
"That's what I'm here for!",
"You are more than welcome.",
"You don't have to thank me, I'm your loyal servant.",
"Don't mention it."
]
shortResponses = [
'vw',
'np',
]
farewellResponses = [
'Goodbye',
'Have a good evening',
'Bye',
'Take care',
'Nice speaking with you',
'See you later'
]
# http://en.wikipedia.org/wiki/You_talkin'_to_me%3F
youTalkinToMe = (msg, robot) ->
input = msg.message.text.toLowerCase()
name = robot.name.toLowerCase()
input.indexOf(name) != -1
module.exports = (robot) ->
robot.hear /\b(thanks|thank you|cheers|nice one)\b/i, (msg) ->
msg.reply msg.random responses if youTalkinToMe(msg, robot)
robot.hear /\b(ty|thx)\b/i, (msg) ->
msg.reply msg.random shortResponses if youTalkinToMe(msg, robot)
robot.hear /\b(hello|hi|sup|howdy|good (morning|evening|afternoon))\b/i, (msg) ->
msg.reply "#{robot.name} at your service!" if youTalkinToMe(msg, robot)
robot.hear /\b(bye|night|goodbye|good night)\b/i, (msg) ->
msg.reply msg.random farewellResponses if youTalkinToMe(msg, robot)
Jump to Line
Something went wrong with that request. Please try again.