From 833e5c6cd66307a2b2d5874b9b584e473c32d417 Mon Sep 17 00:00:00 2001 From: HitomaruKonpaku Date: Tue, 24 Sep 2024 16:50:08 +0700 Subject: [PATCH] Ignore some action with max age --- .../youtube/base/base-action-handler.ts | 32 ++++++++++++------- 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/apps/back-end/src/module/youtube/base/base-action-handler.ts b/apps/back-end/src/module/youtube/base/base-action-handler.ts index 0751c4d..31ee041 100644 --- a/apps/back-end/src/module/youtube/base/base-action-handler.ts +++ b/apps/back-end/src/module/youtube/base/base-action-handler.ts @@ -4,6 +4,7 @@ import { Track, TrackService } from '@app/track' import { UserFilter, UserFilterRepository, UserFilterType, UserSourceType } from '@app/user' import { YoutubeChatAction, YoutubeChatActionJobData, YoutubeChatUtil } from '@app/youtube' import { ModuleRef } from '@nestjs/core' +import { NumberUtil } from '@shared/util/number.util' import { bold, inlineCode } from 'discord.js' import { AddBannerAction, @@ -104,12 +105,13 @@ export abstract class BaseActionHandler maxAge) { + return + } + } if (this.data.video.isMembersOnly && !track.allowMemberChat) { return } @@ -142,16 +144,22 @@ export abstract class BaseActionHandler v).join(' ') const displayMessage = message - ? ` ${bold(inlineCode(message))}` + ? `${bold(inlineCode(message))}` : '' + let primaryLine = displayHeader + if (displayMessage) { + primaryLine += `: ${displayMessage}` + } + const lines = [ - `${[ - YoutubeChatHandlerUtil.getSrcHyperlink(this.data), - icons.join(' '), - name, - ].filter((v) => v).join(' ')}:${displayMessage}`, + primaryLine, ] if (!YoutubeChatUtil.isAddBannerAction(action) && !track.sourceId) {