提交 254cee44 编写于 作者: Huan (李卓桓)'s avatar Huan (李卓桓)

Fix empty string not clean the announce problem (#1902)

上级 fcec6e7a
......@@ -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<void | string> {
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)
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册