1
0
forked from noxious/server
Files
noxious_server/src/commands/alert.ts
2025-02-12 00:50:51 +01:00

14 lines
462 B
TypeScript

import { BaseCommand } from '@/application/base/baseCommand'
import { SocketEvent } from '@/application/enums'
import { Server } from 'socket.io'
type CommandInput = string[]
export default class AlertCommand extends BaseCommand {
public execute(input: CommandInput): void {
const message: string = input.join(' ') ?? null
if (!message) return console.log('message is required')
this.io.emit(SocketEvent.NOTIFICATION, { message: message })
}
}