hardlounge/client/js/socket-events/commands.js
2021-07-06 15:43:02 +00:00

13 lines
365 B
JavaScript

const constants = require("../constants");
import localCommands from "../commands/index";
import socket from "../socket";
const clientCommands = Object.keys(localCommands).map((cmd) => `/${cmd}`);
socket.on("commands", function (commands) {
if (commands) {
const cmds = [...new Set(commands.concat(clientCommands))];
constants.commands = cmds.sort();
}
});