mirror of
https://github.com/benjamin-wilson/public-pool.git
synced 2026-09-29 09:05:06 -07:00
restarted notification
This commit is contained in:
@@ -83,8 +83,9 @@ export class StratumV1Client extends EasyUnsubscribe {
|
|||||||
try {
|
try {
|
||||||
parsedMessage = JSON.parse(message);
|
parsedMessage = JSON.parse(message);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(e);
|
console.log("Invalid JSON");
|
||||||
this.promiseSocket.end();
|
this.promiseSocket.end();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (parsedMessage.method) {
|
switch (parsedMessage.method) {
|
||||||
|
|||||||
@@ -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) {
|
public async notifySubscribersBlockFound(height: number, block: Block, message: string) {
|
||||||
if (this.bot == null) {
|
if (this.bot == null) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ export class NotificationService implements OnModuleInit {
|
|||||||
) { }
|
) { }
|
||||||
|
|
||||||
async onModuleInit(): Promise<void> {
|
async onModuleInit(): Promise<void> {
|
||||||
|
await this.discordService.notifyRestarted();
|
||||||
}
|
}
|
||||||
|
|
||||||
public async notifySubscribersBlockFound(address: string, height: number, block: Block, message: string) {
|
public async notifySubscribersBlockFound(address: string, height: number, block: Block, message: string) {
|
||||||
|
|||||||
Reference in New Issue
Block a user