diff --git a/src/alice.ts b/src/alice.ts index 6509fba..f31cf5a 100644 --- a/src/alice.ts +++ b/src/alice.ts @@ -79,10 +79,9 @@ export class Alice implements IAlice { if (data.version !== ALICE_PROTOCOL_VERSION) { throw new Error('Unknown protocol version'); } - debug('>> ', data.request.command); + debug(`incoming request: ${data.request.command}`); const context = this._buildContext(data); const result = await this._runMiddlewares(context); - debug('result', result); if (!result) { throw new Error( 'No response for request ' + @@ -91,6 +90,7 @@ export class Alice implements IAlice { ); } + debug(`outcoming result: ${result.responseBody.text}`); return { response: result.responseBody, session: { diff --git a/src/server/webhookServer.ts b/src/server/webhookServer.ts index 634e941..dc7ccef 100644 --- a/src/server/webhookServer.ts +++ b/src/server/webhookServer.ts @@ -53,12 +53,10 @@ export class WebhookServer { request: http.IncomingMessage, response: http.ServerResponse, ): Promise { - debug('incoming request'); if (!isAvailableMethod(request.method) || request.url !== this.webhookUrl) { response.statusCode = 400; return response.end(); } - debug('good request'); const requestBody = await WebhookServer._readRequest(request); const responseBody = await this._handleAliceRequest(requestBody);