diff --git a/src/ai.ts b/src/ai.ts index 74d7270..d9bc9a1 100644 --- a/src/ai.ts +++ b/src/ai.ts @@ -507,4 +507,12 @@ export default class 藍 { this.meta.update(rec); } + + /** + * ご主人様かどうかを返します + */ + @autobind + public isMaster(userId: User['id']): boolean { + return config.masterID === userId; + } } diff --git a/src/config.ts b/src/config.ts index 81892a6..86bd26d 100644 --- a/src/config.ts +++ b/src/config.ts @@ -2,6 +2,7 @@ type Config = { host: string; i: string; master?: string; + masterID?: string; wsUrl: string; apiUrl: string; keywordEnabled: boolean; diff --git a/src/index.ts b/src/index.ts index da62caa..2cb044d 100644 --- a/src/index.ts +++ b/src/index.ts @@ -85,7 +85,7 @@ promiseRetry(retry => { new PingModule(), new WelcomeModule(), new ServerModule(), - new FollowModule(), + // new FollowModule(), new BirthdayModule(), new ValentineModule(), new KeywordModule(), diff --git a/src/misskey/note.ts b/src/misskey/note.ts index 7aa0aff..075f9c0 100644 --- a/src/misskey/note.ts +++ b/src/misskey/note.ts @@ -1,6 +1,13 @@ export type Note = { id: string; + createdAt: Date; + userId: string; + user: { + id: string; + }, text: string | null; + cw: string | null; + visibility: "public" | "home" | "followers" | "specified"; reply: any | null; poll?: { choices: { diff --git a/src/modules/emoji-react/index.ts b/src/modules/emoji-react/index.ts index 4f2b74b..133abe4 100644 --- a/src/modules/emoji-react/index.ts +++ b/src/modules/emoji-react/index.ts @@ -91,7 +91,12 @@ export default class extends Module { if (includes(note.text, ['寿司', 'sushi']) || note.text === 'すし') return react('🍣'); if (includes(note.text, ['ずなず']) || includes(note.text, ['ずにゃず'])) return react('🙌'); - if (includes(note.text, ['なず']) || includes(note.text, ['にゃず'])) return react(':google_hart:'); + if (includes(note.text, ['なず']) || includes(note.text, ['にゃず'])) { + if (this.ai.isMaster(note.userId)) { + return react(':google_hart:') + } + return react(':oltu:'); + }; const gameReact = [ ':ysvi:',