add: Bot Trending Toggle, Hide Bot in Timeline client option

This commit is contained in:
Mar0xy 2023-10-18 07:29:16 +02:00
parent fa5cf36602
commit c21d255604
No known key found for this signature in database
GPG key ID: 56569BBE47D2C828
19 changed files with 90 additions and 1 deletions

View file

@ -46,6 +46,7 @@ export const paramDef = {
withFiles: { type: 'boolean', default: false },
withRenotes: { type: 'boolean', default: true },
withReplies: { type: 'boolean', default: false },
withBots: { type: 'boolean', default: true },
excludeNsfw: { type: 'boolean', default: false },
limit: { type: 'integer', minimum: 1, maximum: 100, default: 10 },
sinceId: { type: 'string', format: 'misskey:id' },
@ -119,6 +120,8 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
.leftJoinAndSelect('renote.user', 'renoteUser')
.leftJoinAndSelect('note.channel', 'channel');
if (!ps.withBots) query.andWhere('user.isBot = FALSE');
let timeline = await query.getMany();
timeline = timeline.filter(note => {