Last active
September 23, 2018 18:58
-
-
Save dcorvus/d2817deaafdc56ecc9daabefefec3d73 to your computer and use it in GitHub Desktop.
A backup of General Wrex's NPM Module Installation command.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "npm", | |
"permissions": "NONE", | |
"restriction": "4", | |
"_id": "UwRCF", | |
"actions": [ | |
{ | |
"info": "0", | |
"infoIndex": "1", | |
"storage": "1", | |
"varName": "moduleName", | |
"name": "Store Command Params" | |
}, | |
{ | |
"channel": "0", | |
"varName": "", | |
"message": "Attempting to install node module: ${tempVars(\"moduleName\")}", | |
"storage": "0", | |
"varName2": "", | |
"name": "Send Message" | |
}, | |
{ | |
"behavior": "1", | |
"interpretation": "0", | |
"code": "\nvar moduleName = tempVars(\"moduleName\");\n\ntry{ \nrequire.resolve(moduleName)\nmsg.channel.send(\"Module '\"+ moduleName + \"' is already installed!\"); \n\n}catch(err){\nmsg.channel.send(\"Installing/Updating node module '\"+ moduleName + \"'\"); \n\nvar theModule = this.getWrexMods().require(moduleName);\n\nif(theModule){\n msg.channel.send(\"\"+ moduleName + \" was installed to the bot!\"); \n}else{\n msg.channel.send(\"Error! Module NOT \"+ moduleName + \" installed to the bot!\"); \n}\n\n}\n\n\n\n \n", | |
"storage": "0", | |
"varName": "", | |
"name": "Run Script" | |
}, | |
{ | |
"channel": "0", | |
"varName": "", | |
"message": "**NPM_INSTALL**: ${tempVars(\"installMessage\")}", | |
"storage": "0", | |
"varName2": "", | |
"name": "Send Message" | |
} | |
], | |
"comType": "0", | |
"_aliases": [] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment