Skip to content

Commit

Permalink
Update message.ts
Browse files Browse the repository at this point in the history
change the Message.toString format, ref wechaty#1676
  • Loading branch information
suntong authored Dec 26, 2018
1 parent 46cb7ae commit cf9cd6e
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/user/message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,22 +224,19 @@ export class Message extends Accessory implements Sayable {
const msgStrList = [
'Message',
`#${MessageType[this.type()]}`,
'(',
this.room()
? '👥' + this.room()
: '',
'[',
this.from()
? '🗣' + this.from()
: '',
this.to()
? '👤' + this.to()
this.room()
? '@👥' + this.room()
: '',
')',
']',
]
if ( this.type() === Message.Type.Text
|| this.type() === Message.Type.Unknown
) {
msgStrList.push(`<${this.text().substr(0, 70)}>`)
msgStrList.push(`\t${this.text().substr(0, 70)}`)
} else {
log.silly('Message', 'toString() for message type: %s(%s)', Message.Type[this.type()], this.type())

Expand Down

0 comments on commit cf9cd6e

Please sign in to comment.