Do not tweet on Sunday (#712)
This commit is contained in:
parent
4ec351369b
commit
ca46a9827a
@ -6,6 +6,7 @@ import {
|
|||||||
} from '@ghostfolio/common/config';
|
} from '@ghostfolio/common/config';
|
||||||
import { resolveFearAndGreedIndex } from '@ghostfolio/common/helper';
|
import { resolveFearAndGreedIndex } from '@ghostfolio/common/helper';
|
||||||
import { Injectable, Logger } from '@nestjs/common';
|
import { Injectable, Logger } from '@nestjs/common';
|
||||||
|
import { isSunday } from 'date-fns';
|
||||||
import { TwitterApi, TwitterApiReadWrite } from 'twitter-api-v2';
|
import { TwitterApi, TwitterApiReadWrite } from 'twitter-api-v2';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
@ -27,7 +28,10 @@ export class TwitterBotService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public async tweetFearAndGreedIndex() {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user