diff --git a/packages/backend/src/server/api/endpoints/following/create.ts b/packages/backend/src/server/api/endpoints/following/create.ts index db320e712..3c27af604 100644 --- a/packages/backend/src/server/api/endpoints/following/create.ts +++ b/packages/backend/src/server/api/endpoints/following/create.ts @@ -58,6 +58,12 @@ export const meta = { code: 'BLOCKED', id: 'c4ab57cc-4e41-45e9-bfd9-584f61e35ce0', }, + + followingAnotherBot: { + message: 'Following another bot account is not allowed.', + code: 'FOLLOWING_BOT_NOT_ALLOWED', + id: '9a61d572-4a95-7f6b-b595-2817d42017b0', + }, }, res: { @@ -100,6 +106,10 @@ export default class extends Endpoint { // eslint- throw err; }); + if ( me.isBot && followee.isBot ) { + throw new ApiError(meta.errors.followingAnotherBot); + } + try { await this.userFollowingService.follow(follower, followee, { withReplies: ps.withReplies }); } catch (e) { diff --git a/packages/backend/src/server/api/endpoints/notes/create.ts b/packages/backend/src/server/api/endpoints/notes/create.ts index 812c1a45b..5bff7f718 100644 --- a/packages/backend/src/server/api/endpoints/notes/create.ts +++ b/packages/backend/src/server/api/endpoints/notes/create.ts @@ -141,6 +141,13 @@ export const meta = { code: 'CONTAINS_TOO_MANY_MENTIONS', id: '4de0363a-3046-481b-9b0f-feff3e211025', }, + + replyingToAnotherBot: { + message: 'Replying to another bot account is not allowed.', + code: 'REPLY_TO_BOT_NOT_ALLOWED', + id: '66819f28-9525-389d-4b0a-4974363fbbbf', + }, + }, } as const; @@ -375,6 +382,11 @@ export default class extends Endpoint { // eslint- throw new ApiError(meta.errors.cannotReplyToInvisibleNote); } else if (reply.visibility === 'specified' && ps.visibility !== 'specified') { throw new ApiError(meta.errors.cannotReplyToSpecifiedVisibilityNoteWithExtendedVisibility); + } else if ( me.isBot ) { + const replayuser = await this.usersRepository.findOneBy({ id: reply.userId }); + if (replayuser?.isBot) { + throw new ApiError(meta.errors.replyingToAnotherBot); + } } // Check blocking diff --git a/packages/misskey-js/src/autogen/types.ts b/packages/misskey-js/src/autogen/types.ts index ddfb6085c..72b84f2db 100644 --- a/packages/misskey-js/src/autogen/types.ts +++ b/packages/misskey-js/src/autogen/types.ts @@ -4910,6 +4910,7 @@ export type components = { canSearchNotes: boolean; canUseTranslator: boolean; canUseDriveFileInSoundSettings: boolean; + canUseReaction: boolean; canHideAds: boolean; driveCapacityMb: number; alwaysMarkNsfw: boolean;