restarted notification

This commit is contained in:
Ben
2023-07-09 20:28:50 -04:00
parent e9ae1853af
commit bca122833c
3 changed files with 13 additions and 2 deletions
+2 -1
View File
@@ -83,8 +83,9 @@ export class StratumV1Client extends EasyUnsubscribe {
try {
parsedMessage = JSON.parse(message);
} catch (e) {
console.log(e);
console.log("Invalid JSON");
this.promiseSocket.end();
return;
}
switch (parsedMessage.method) {
+10
View File
@@ -103,6 +103,16 @@ export class DiscordService implements OnModuleInit {
}
}
public async notifyRestarted() {
if (this.bot == null) {
return;
}
const guild = await this.bot.guilds.fetch(this.guildId);
const channel = await guild.channels.fetch(this.channelId) as TextChannel;
channel.send(`Server Restarted.`);
}
public async notifySubscribersBlockFound(height: number, block: Block, message: string) {
if (this.bot == null) {
return;
+1 -1
View File
@@ -14,7 +14,7 @@ export class NotificationService implements OnModuleInit {
) { }
async onModuleInit(): Promise<void> {
await this.discordService.notifyRestarted();
}
public async notifySubscribersBlockFound(address: string, height: number, block: Block, message: string) {