Only add /search when there's a message provider
This commit is contained in:
parent
058b3155d0
commit
69c37a535b
@ -1,4 +1,4 @@
|
|||||||
const clientSideCommands = ["/collapse", "/expand", "/search"];
|
const clientSideCommands = ["/collapse", "/expand"];
|
||||||
|
|
||||||
const passThroughCommands = [
|
const passThroughCommands = [
|
||||||
"/as",
|
"/as",
|
||||||
@ -43,13 +43,19 @@ const userInputs = [
|
|||||||
|
|
||||||
const pluginCommands = new Map();
|
const pluginCommands = new Map();
|
||||||
|
|
||||||
const getCommands = () =>
|
const getCommands = (client) => {
|
||||||
Array.from(userInputs.keys())
|
const commands = Array.from(userInputs.keys())
|
||||||
.concat(Array.from(pluginCommands.keys()))
|
.concat(Array.from(pluginCommands.keys()))
|
||||||
.map((command) => `/${command}`)
|
.map((command) => `/${command}`)
|
||||||
.concat(clientSideCommands)
|
.concat(clientSideCommands)
|
||||||
.concat(passThroughCommands)
|
.concat(passThroughCommands);
|
||||||
.sort();
|
|
||||||
|
if (client.messageProvider !== undefined) {
|
||||||
|
commands.push("/search");
|
||||||
|
}
|
||||||
|
|
||||||
|
return commands.sort();
|
||||||
|
};
|
||||||
|
|
||||||
const addPluginCommand = (packageInfo, command, func) => {
|
const addPluginCommand = (packageInfo, command, func) => {
|
||||||
func.packageInfo = packageInfo;
|
func.packageInfo = packageInfo;
|
||||||
|
@ -692,7 +692,7 @@ function initializeClient(socket, client, token, lastMessage, openChannel) {
|
|||||||
),
|
),
|
||||||
token: tokenToSend,
|
token: tokenToSend,
|
||||||
});
|
});
|
||||||
socket.emit("commands", inputs.getCommands());
|
socket.emit("commands", inputs.getCommands(client));
|
||||||
};
|
};
|
||||||
|
|
||||||
if (Helper.config.public) {
|
if (Helper.config.public) {
|
||||||
|
Loading…
Reference in New Issue
Block a user