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

add logs

上级 218fbfe0
......@@ -422,16 +422,18 @@ export class Bridge extends EventEmitter {
}
}
public async send(toUserName: string, content: string): Promise<void> {
public async send(toUserName: string, text: string): Promise<void> {
log.verbose('PuppetPuppeteerBridge', 'send(%s, %s)', toUserName, text)
if (!toUserName) {
throw new Error('UserName not found')
}
if (!content) {
if (!text) {
throw new Error('cannot say nothing')
}
try {
const ret = await this.proxyWechaty('send', toUserName, content)
const ret = await this.proxyWechaty('send', toUserName, text)
if (!ret) {
throw new Error('send fail')
}
......@@ -578,6 +580,8 @@ export class Bridge extends EventEmitter {
}
public async sendMedia(mediaData: MediaData): Promise<boolean> {
log.verbose('PuppetPuppeteerBridge', 'sendMedia(mediaData)')
if (!mediaData.ToUserName) {
throw new Error('UserName not found')
}
......@@ -593,6 +597,8 @@ export class Bridge extends EventEmitter {
}
public async forward(baseData: MsgRawObj, patchData: MsgRawObj): Promise<boolean> {
log.verbose('PuppetPuppeteerBridge', 'forward()')
if (!baseData.ToUserName) {
throw new Error('UserName not found')
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册