diff --git a/src/ai.ts b/src/ai.ts index 3e97984..1d413f8 100644 --- a/src/ai.ts +++ b/src/ai.ts @@ -130,6 +130,12 @@ export default class 藍 { private async onReceiveMessage(msg: Message): Promise { this.log(chalk.gray(`<<< An message received: ${chalk.underline(msg.id)}`)); + // Ignore message if the user is a bot + // To avoid infinity reply loop. + if (msg.user.isBot) { + return; + } + const isNoContext = !msg.isDm && msg.replyId == null; // Look up the context diff --git a/src/misskey/user.ts b/src/misskey/user.ts index d2438cc..7206d2b 100644 --- a/src/misskey/user.ts +++ b/src/misskey/user.ts @@ -3,4 +3,5 @@ export type User = { name: string; username: string; isFollowing: boolean; + isBot: boolean; };