forked from noxious/server
Improved folder structures for better maintainability
This commit is contained in:
9
src/commands/alert.ts
Normal file
9
src/commands/alert.ts
Normal file
@ -0,0 +1,9 @@
|
||||
import { Server } from "socket.io";
|
||||
|
||||
type CommandInput = string[]
|
||||
|
||||
export default function (input: CommandInput, io: Server) {
|
||||
const message: string = input.join(' ') ?? null;
|
||||
if (!message) return console.log('message is required');
|
||||
io.emit('notification', {message: message});
|
||||
};
|
Reference in New Issue
Block a user