This commit is contained in:
syuilo 2018-08-11 12:34:24 +09:00
parent dbae24bcc8
commit 72ed4edf10
2 changed files with 8 additions and 8 deletions

View file

@ -79,6 +79,8 @@ export default class 藍 {
} }
private onMention = (msg: MessageLike) => { private onMention = (msg: MessageLike) => {
console.log(`mention received: ${msg.id}`);
// リアクションする // リアクションする
if (!msg.isMessage) { if (!msg.isMessage) {
setTimeout(() => { setTimeout(() => {
@ -98,17 +100,13 @@ export default class 藍 {
} }
public post = (param: any) => { public post = (param: any) => {
setTimeout(() => {
request.post('notes/create', param); request.post('notes/create', param);
}, 2000);
} }
public sendMessage = (userId: any, param: any) => { public sendMessage = (userId: any, param: any) => {
setTimeout(() => {
this.api('messages/create', Object.assign({ this.api('messages/create', Object.assign({
userId: userId, userId: userId,
}, param)); }, param));
}, 2000);
} }
public api = (endpoint: string, param) => { public api = (endpoint: string, param) => {

View file

@ -24,6 +24,8 @@ export default class MessageLike {
} }
public reply = (text: string) => { public reply = (text: string) => {
console.log(`sending reply of ${this.id} ...`);
setTimeout(() => { setTimeout(() => {
if (this.isMessage) { if (this.isMessage) {
this.ai.sendMessage(this.messageOrNote.userId, { this.ai.sendMessage(this.messageOrNote.userId, {