mirror of
https://github.com/benjamin-wilson/public-pool.git
synced 2026-09-29 17:15:03 -07:00
24 lines
828 B
TypeScript
24 lines
828 B
TypeScript
import { Injectable, OnModuleInit } from '@nestjs/common';
|
|
import { Block } from 'bitcoinjs-lib';
|
|
|
|
import { DiscordService } from './discord.service';
|
|
import { TelegramService } from './telegram.service';
|
|
|
|
|
|
@Injectable()
|
|
export class NotificationService implements OnModuleInit {
|
|
|
|
constructor(
|
|
private readonly telegramService: TelegramService,
|
|
private readonly discordService: DiscordService
|
|
) { }
|
|
|
|
async onModuleInit(): Promise<void> {
|
|
await this.discordService.notifyRestarted();
|
|
}
|
|
|
|
public async notifySubscribersBlockFound(address: string, height: number, block: Block, message: string) {
|
|
await this.discordService.notifySubscribersBlockFound(height, block, message);
|
|
await this.telegramService.notifySubscribersBlockFound(address, height, block, message);
|
|
}
|
|
} |