Skip to main content
The Deno 2 Release Candidate is here
Learn more
class NotificationSendHelper
Re-export
import { NotificationSendHelper } from "https://deno.land/x/sptaki@1.2.0/helpers/mod.ts";

Constructors

new
NotificationSendHelper(
webSocketServer: WebSocketServer,
hashUtil: HashUtil,
saveServer: SaveServer,
notificationService: NotificationService,
)

Properties

protected
hashUtil: HashUtil
protected
notificationService: NotificationService
protected
saveServer: SaveServer
protected
webSocketServer: WebSocketServer

Methods

protected
getDialog(
sessionId: string,
messageType: MessageType,
senderDetails: IUserDialogInfo,
): Dialogue

Helper function for sendMessageToPlayer(), get new dialog for storage in profile or find existing by sender id

sendMessage(sessionID: string, notificationMessage: INotification): void

Send notification message to the appropriate channel

sendMessageToPlayer(
sessionId: string,
senderDetails: IUserDialogInfo,
messageText: string,
messageType: MessageType,
): void

Send a message directly to the player