diff --git a/src/user/room.ts b/src/user/room.ts index b9e52e795c4bd53095b61d5a59bebde989f4a310..af2b1db4a826a8fa7ebd69eeac41b7ea3b1f24bf 100644 --- a/src/user/room.ts +++ b/src/user/room.ts @@ -933,13 +933,17 @@ export class Room extends Accessory implements Sayable { * console.log(`room announce change from ${oldAnnounce} to ${room.announce()}`) */ public async announce (text?: string): Promise { - log.verbose('Room', 'announce(%s)', text || '') + log.verbose('Room', 'announce(%s)', + typeof text === 'undefined' + ? '' + : `"${text || ''}"` + ) - if (text) { - await this.puppet.roomAnnounce(this.id, text) - } else { + if (typeof text === 'undefined') { const announcement = await this.puppet.roomAnnounce(this.id) return announcement + } else { + await this.puppet.roomAnnounce(this.id, text) } }