Browse Source

Task/implement OnModuleInit interface in TwitterBotService (#6447)

* Implement OnModuleInit interface
pull/6467/head
Thomas Kaul 5 days ago
committed by GitHub
parent
commit
86d4d6ed64
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 8
      apps/api/src/services/twitter-bot/twitter-bot.service.ts

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

@ -10,19 +10,21 @@ import {
resolveMarketCondition resolveMarketCondition
} from '@ghostfolio/common/helper'; } from '@ghostfolio/common/helper';
import { Injectable, Logger } from '@nestjs/common'; import { Injectable, Logger, OnModuleInit } from '@nestjs/common';
import { isWeekend } from 'date-fns'; import { isWeekend } from 'date-fns';
import { TwitterApi, TwitterApiReadWrite } from 'twitter-api-v2'; import { TwitterApi, TwitterApiReadWrite } from 'twitter-api-v2';
@Injectable() @Injectable()
export class TwitterBotService { export class TwitterBotService implements OnModuleInit {
private twitterClient: TwitterApiReadWrite; private twitterClient: TwitterApiReadWrite;
public constructor( public constructor(
private readonly benchmarkService: BenchmarkService, private readonly benchmarkService: BenchmarkService,
private readonly configurationService: ConfigurationService, private readonly configurationService: ConfigurationService,
private readonly symbolService: SymbolService private readonly symbolService: SymbolService
) { ) {}
public onModuleInit() {
this.twitterClient = new TwitterApi({ this.twitterClient = new TwitterApi({
accessSecret: this.configurationService.get( accessSecret: this.configurationService.get(
'TWITTER_ACCESS_TOKEN_SECRET' 'TWITTER_ACCESS_TOKEN_SECRET'

Loading…
Cancel
Save