Skip to content
This repository was archived by the owner on Jun 8, 2023. It is now read-only.

What does the fox say!? #1130

Closed
wants to merge 2 commits into from
Closed
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
28 changes: 28 additions & 0 deletions src/scripts/fox-say.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Description:
# Let's you know what the fox says!
#
# Dependencies:
# None
#
# Configuration:
# None
#
# Commands:
# hubot what does the fox say

module.exports = (robot) ->

robot.respond /what does the fox say/i, (msg) ->
msg.send ":dog: goes woof"
Copy link
Contributor

Choose a reason for hiding this comment

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

Keep in mind that msg.send is async, so these are likely to come out in the wrong order. You can calling msg.send with multiple strings on it.

Copy link
Author

Choose a reason for hiding this comment

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

Good catch! The order definitely matters!

Copy link
Author

Choose a reason for hiding this comment

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

On second thought, if I send in multiple strings to send it will cause a "paste" like message in campfire which doesn't render the emoji icons. So I'll have to look at a different approach to this.

Copy link
Contributor

Choose a reason for hiding this comment

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

No, msg.send "foo", "bar", "baz" would send three one line messages. If you made one big string with multiple lines, it would go through as a paste.

,":cat2: goes meow"
,":bird: goes tweet"
,"and the :mouse2: goes squeek"
,":cow: goes moo"
,":frog: goes croak"
,"and the :elephant: goes toot"
,":baby_chick: says quack"
,"and :fish: goes blub"
,"and the :dolphin: goes ow ow ow"
,"But there's one sound"
,"That no one knows..."
,"What does the :wolf: say!?"