Skip to content

Commit

Permalink
tweak /channels output
Browse files Browse the repository at this point in the history
  • Loading branch information
cblgh committed Oct 9, 2020
1 parent b662834 commit 5c9b4d1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@ Commander.prototype.setActiveCabal = function (cabal) {
switch (msg.command) {
case "channels":
var {joined, channel, userCount, topic} = msg
var userPart = userCount ? `: ${userCount} ${userCount === 1 ? 'person' : 'people'}` : ''
var userPart = `${userCount} ${userCount === 1 ? 'person' : 'people'}`
userPart = userCount > 0 ? ": " + chalk.cyan(userPart) : ''
var shortTopic = topic.length > 40 ? topic.slice(0, 40) + '..' : topic || ''
shortTopic = util.sanitizeString(shortTopic)
channel = util.sanitizeString(channel)
txt = `${joined ? '*' : ' '} ${channel}${userPart} ${chalk.cyan(shortTopic)}`
txt = `${joined ? '*' : ' '} ${channel}${userPart} ${shortTopic}`
break
}
}
Expand Down

0 comments on commit 5c9b4d1

Please sign in to comment.