From f300043f25592cae3f0c40cf79f0f36c90c39e7a Mon Sep 17 00:00:00 2001 From: Xeltica Date: Mon, 3 Dec 2018 00:26:40 +0900 Subject: [PATCH] =?UTF-8?q?=E6=AF=8E=E5=BA=A6=E5=8F=96=E5=BE=97=E3=81=99?= =?UTF-8?q?=E3=82=8B=E3=81=93=E3=81=A8=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/misskey/user.ts | 2 -- src/modules/follow/index.ts | 8 ++++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/misskey/user.ts b/src/misskey/user.ts index 9338ef2..21c6be8 100644 --- a/src/misskey/user.ts +++ b/src/misskey/user.ts @@ -2,6 +2,4 @@ export type User = { id: string; name: string; username: string; - isFollowing: boolean; - isFollowed: boolean; }; diff --git a/src/modules/follow/index.ts b/src/modules/follow/index.ts index 0e8e265..e68ae2c 100644 --- a/src/modules/follow/index.ts +++ b/src/modules/follow/index.ts @@ -11,9 +11,13 @@ export default class FollowModule implements IModule { this.ai = ai; } - public onMention = (msg: MessageLike) => { + public onMention = async (msg: MessageLike) => { if (msg.text && msg.text.includes('フォロー')) { - if (msg.friend.doc.user.isFollowing) { + const user: any = await this.ai.api("users/show", { + userId: msg.userId, + }); + + if (user.isFollowing) { msg.reply(serifs.follow.alreadyFollowed); } else if (msg.friend.love < -5) { msg.reply(serifs.follow.ng);