From e79be9f2d69f2df16c2c8c4d844777ea3210254a Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Fri, 27 May 2022 11:37:48 +0200 Subject: [PATCH] Feature/do not tweet on weekend (#961) * Do not tweet on the weekend * Update changelog --- CHANGELOG.md | 1 + apps/api/src/services/twitter-bot/twitter-bot.service.ts | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1094ddec0..291735dd3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- Changed the twitter bot service to rest on the weekend - Upgraded `prisma` from version `3.12.0` to `3.14.0` ### Fixed diff --git a/apps/api/src/services/twitter-bot/twitter-bot.service.ts b/apps/api/src/services/twitter-bot/twitter-bot.service.ts index 2829896dd..d820d6c11 100644 --- a/apps/api/src/services/twitter-bot/twitter-bot.service.ts +++ b/apps/api/src/services/twitter-bot/twitter-bot.service.ts @@ -13,7 +13,7 @@ import { } from '@ghostfolio/common/helper'; import { UniqueAsset } from '@ghostfolio/common/interfaces'; import { Injectable, Logger } from '@nestjs/common'; -import { isSunday } from 'date-fns'; +import { isWeekend } from 'date-fns'; import * as roundTo from 'round-to'; import { TwitterApi, TwitterApiReadWrite } from 'twitter-api-v2'; @@ -40,7 +40,7 @@ export class TwitterBotService { public async tweetFearAndGreedIndex() { if ( !this.configurationService.get('ENABLE_FEATURE_FEAR_AND_GREED_INDEX') || - isSunday(new Date()) + isWeekend(new Date()) ) { return; }