2019-12-17 22:10:50 +00:00
|
|
|
const constants = require("../constants");
|
2021-07-06 15:43:02 +00:00
|
|
|
import localCommands from "../commands/index";
|
2019-11-16 17:24:03 +00:00
|
|
|
import socket from "../socket";
|
2019-07-02 16:02:02 +00:00
|
|
|
|
2021-07-06 15:43:02 +00:00
|
|
|
const clientCommands = Object.keys(localCommands).map((cmd) => `/${cmd}`);
|
|
|
|
|
2020-03-21 20:55:36 +00:00
|
|
|
socket.on("commands", function (commands) {
|
2019-07-02 16:02:02 +00:00
|
|
|
if (commands) {
|
2021-07-06 15:43:02 +00:00
|
|
|
const cmds = [...new Set(commands.concat(clientCommands))];
|
|
|
|
constants.commands = cmds.sort();
|
2019-07-02 16:02:02 +00:00
|
|
|
}
|
|
|
|
});
|