-
Notifications
You must be signed in to change notification settings - Fork 129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow a few more commands for chat-commands.js #357
Comments
I will try to submit a PR about this if I finally figure it out how If you want to try it, here's what I changed in the async mount() {
for (const command of this.options.commands) {
const commands = Array.isArray(command.command) ? command.command : [command.command];
for (const cmd of commands) {
this.server.on(`CHAT_COMMAND:${cmd.toLowerCase()}`, async (data) => {
if (command.ignoreChats.includes(data.chat)) return;
if (command.type === 'broadcast') {
await this.server.rcon.broadcast(command.response);
} else if (command.type === 'warn') {
await this.server.rcon.warn(data.player.steamID, command.response);
}
});
}
}
} This way I don't have to reconfigure the existing config and must convert each existing command one I made. As an example: {
"command": "clear",
"type": "broadcast",
"response": "Please clear the chat. Thank you!.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n ",
"ignoreChats": [
"ChatAll",
"ChatTeam",
"ChatSquad"
]
},
{
"command": [
"nomaincamp",
"maincamp",
"main",
"mainbase",
"nomain",
"nocamp",
"mainbasecamp"
],
"type": "broadcast",
"response": "Main Camping violates the server rules. Please keep a safe distance from the enemy's main base.",
"ignoreChats": [
"ChatAll",
"ChatTeam",
"ChatSquad"
]
} |
If not I can attempt to push one for you. All we ask is not to modify flags as they are tied to GitHub actions. |
Please do thank you! |
Haven’t forgotten still plan on doing this. Going to make a branch here for it. |
I'm not sure I get what is being suggested here. Do you mean you want aliases for the same command? For example, |
Now that I see Thomas' comment, would it be better to add another option called |
indeed! Back in the days in PR (and still working nowadays afaik), !r, !report and !calladmin worked for the function to send a message to admins. |
What is the issue, e.g. map voting, you would like to solve?
Currently only supports "command", and not "command2", "command3" for example.
How would you like us to solve this issue?
To make this work like this (example words "version" and "website". Project Reality servers also support those commands iirc)
Additional Info
It currently outright ignores command2 and command3 variables.
The text was updated successfully, but these errors were encountered: