From 92af7a603eba946454f8ca48f0de6ed4ccefa47f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Si=C3=B4n=20Le=20Roux?= Date: Thu, 22 Aug 2019 01:02:28 +0200 Subject: [PATCH] Use Coffeescript conditional assignment shorthand Because what we're assigning in the happy side of this condition is the same as what we're checking in its expression we can use Coffeescript's shorthand with the existential operator, i.e. instead of a = if b? then b else c use this: a = b ? c Source: https://coffeescript.org/#existential-operator --- src/bot.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bot.coffee b/src/bot.coffee index 8779dc0a..3198a91e 100644 --- a/src/bot.coffee +++ b/src/bot.coffee @@ -238,7 +238,7 @@ class SlackBot extends Adapter # Hubot expects all user objects to have a room property that is used in the envelope for the message after it # is received - user.room = if channel? then channel else "" + user.room = channel ? "" switch event.subtype when "bot_message"