use abstract class

This commit is contained in:
Alex Holliday committed 2026-04-13 12:55:20 -07:00
1 parent 0bb3320010
commit 22f54391d0
8 files changed
+31 -67

No files matched your search

@@ -1,18 +1,11 @@
const SERVICE_NAME = "DiscordProvider";
import type { AlertDiscordPayload, DiscordEmbedField, Notification } from "@/types/index.js";
import { INotificationProvider } from "@/service/index.js";
import { NotificationProvider } from "@/service/index.js";
import { getTestMessage } from "@/service/infrastructure/notificationProviders/utils.js";
import type { NotificationMessage, NotificationSeverity } from "@/types/notificationMessage.js";
import got from "got";
import { ILogger } from "@/utils/logger.js";
export class DiscordProvider implements INotificationProvider {
private logger: ILogger;
constructor(logger: ILogger) {
this.logger = logger;
}
export class DiscordProvider extends NotificationProvider {
sendTestAlert = async (notification: Partial<Notification>) => {
if (!notification.address) {
return false;
@@ -23,6 +16,7 @@ export class DiscordProvider implements INotificationProvider {
headers: {
"Content-Type": "application/json",
},
...this.gotRequestOptions(),
});
return true;
} catch (error) {
@@ -55,6 +49,7 @@ export class DiscordProvider implements INotificationProvider {
headers: {
"Content-Type": "application/json",
},
...this.gotRequestOptions(),
});
return true;
} catch (error) {