From 72ed4edf10c32dfe07218b10f4181b22273aea9a Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 11 Aug 2018 12:34:24 +0900 Subject: [PATCH] :v: --- src/index.ts | 14 ++++++-------- src/message-like.ts | 2 ++ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/index.ts b/src/index.ts index 44e7e59..0c2ddf5 100644 --- a/src/index.ts +++ b/src/index.ts @@ -79,6 +79,8 @@ export default class 藍 { } private onMention = (msg: MessageLike) => { + console.log(`mention received: ${msg.id}`); + // リアクションする if (!msg.isMessage) { setTimeout(() => { @@ -98,17 +100,13 @@ export default class 藍 { } public post = (param: any) => { - setTimeout(() => { - request.post('notes/create', param); - }, 2000); + request.post('notes/create', param); } public sendMessage = (userId: any, param: any) => { - setTimeout(() => { - this.api('messages/create', Object.assign({ - userId: userId, - }, param)); - }, 2000); + this.api('messages/create', Object.assign({ + userId: userId, + }, param)); } public api = (endpoint: string, param) => { diff --git a/src/message-like.ts b/src/message-like.ts index 951694e..b80ec60 100644 --- a/src/message-like.ts +++ b/src/message-like.ts @@ -24,6 +24,8 @@ export default class MessageLike { } public reply = (text: string) => { + console.log(`sending reply of ${this.id} ...`); + setTimeout(() => { if (this.isMessage) { this.ai.sendMessage(this.messageOrNote.userId, {