Browse Source

Do not tweet on Sunday (#712)

pull/713/head
Thomas Kaul 3 years ago
committed by GitHub
parent
commit
ca46a9827a
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      apps/api/src/services/twitter-bot/twitter-bot.service.ts

6
apps/api/src/services/twitter-bot/twitter-bot.service.ts

@ -6,6 +6,7 @@ import {
} from '@ghostfolio/common/config';
import { resolveFearAndGreedIndex } from '@ghostfolio/common/helper';
import { Injectable, Logger } from '@nestjs/common';
import { isSunday } from 'date-fns';
import { TwitterApi, TwitterApiReadWrite } from 'twitter-api-v2';
@Injectable()
@ -27,7 +28,10 @@ export class TwitterBotService {
}
public async tweetFearAndGreedIndex() {
if (!this.configurationService.get('ENABLE_FEATURE_FEAR_AND_GREED_INDEX')) {
if (
!this.configurationService.get('ENABLE_FEATURE_FEAR_AND_GREED_INDEX') ||
isSunday(new Date())
) {
return;
}

Loading…
Cancel
Save