1
0
Fork 0
mirror of https://github.com/NovaGM/Modules.git synced 2024-08-14 22:47:01 +00:00

Added commands experiments

(requires GooseMod 7.3.0-dev)
This commit is contained in:
フズキ 2021-03-25 00:23:07 +01:00
parent 3da9848a0e
commit 4676a8d90e
No known key found for this signature in database
GPG key ID: AD7750AB4625F1DD
2 changed files with 52 additions and 0 deletions

View file

@ -0,0 +1,11 @@
{
"main": "index.js",
"name": "CommandsExperiment",
"description": "GooseMod commands experiment [requires GMv7.3.0 or higher]",
"tags": ["test"],
"authors": ["186496078273708033"],
"version": "1.0.0"
}

View file

@ -0,0 +1,41 @@
import {commands, internalMessage} from '@goosemod/patcher';
export default {
goosemodHandlers: {
onImport: () => {
commands.add(
"command-name",
"command-description",
(...args) => console.log(args),
[
{
type: 3,
name: "command-string-parameter",
description: "parameter-description",
required: false
}
]
);
commands.add(
"echo",
"Prints out all of the message's text in an internal message.",
(args) => {
internalMessage(args.text[0].text);
console.log(args);
},
[
{
type: 3,
name: "text",
description: "Text to be printed in an internal message.",
required: true
}
]
);
},
onRemove: () => {
commands.remove("command-name");
commands.remove("echo");
},
},
};