tutorial: don't let punctuation get in the way of exiting.

(imported from commit 7b97f382684bd2ddb92fc3efa6e1a635c4662aef)
This commit is contained in:
Jessica McKellar 2013-04-12 18:03:08 -04:00
parent a76977f57f
commit 3945335e6e
1 changed files with 2 additions and 1 deletions

View File

@ -61,7 +61,8 @@ function any_message_to_me(message) {
var received_messages = [];
exports.message_was_sent = function(message) {
var trimmed_content = message.content.trim().toLowerCase();
// Don't let casing or stray punctuation get in the way.
var trimmed_content = message.content.substring(0, 4).toLowerCase();
if (any_message_to_me(message) &&
(trimmed_content === 'exit' || trimmed_content === 'stop')) {
sleep(1000).then(function () {