forked from noxious/server
14 lines
462 B
TypeScript
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 })
|
|
}
|
|
}
|