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:
parent
3da9848a0e
commit
4676a8d90e
2 changed files with 52 additions and 0 deletions
11
commands-experiment/goosemodModule.json
Normal file
11
commands-experiment/goosemodModule.json
Normal 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"
|
||||
}
|
41
commands-experiment/index.js
Normal file
41
commands-experiment/index.js
Normal 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");
|
||||
},
|
||||
},
|
||||
};
|
Loading…
Reference in a new issue