Improve exec cmd
This commit is contained in:
parent
1ea0adc962
commit
4c44089e6c
|
@ -89,7 +89,8 @@ global.commands = {
|
||||||
|
|
||||||
"eval": {
|
"eval": {
|
||||||
op: true,
|
op: true,
|
||||||
usage: "<javascript>",
|
description: "Evaluate javascript",
|
||||||
|
usage: "<code>",
|
||||||
aliases: ['>'],
|
aliases: ['>'],
|
||||||
exec: async function (message) {
|
exec: async function (message) {
|
||||||
var msg = message, m = message,
|
var msg = message, m = message,
|
||||||
|
@ -110,19 +111,16 @@ global.commands = {
|
||||||
|
|
||||||
"exec": {
|
"exec": {
|
||||||
op: true,
|
op: true,
|
||||||
|
description: "Run a shell command",
|
||||||
usage: "<command>",
|
usage: "<command>",
|
||||||
aliases: ["$"],
|
aliases: ["$"],
|
||||||
exec: async function (msg) {
|
exec: async function (msg) {
|
||||||
require("child_process").exec(msg.txt(1), function(error, stdout, stderr){
|
require("child_process").exec(msg.txt(1), function(error, stdout, stderr){
|
||||||
if (error) msg.channel.send(error, {split:{char:''}});
|
if (error) msg.channel.send(error, {split:{char:'',maxLength:2000}});
|
||||||
else {
|
if (stdout) msg.channel.send(stdout, {split:{char:'',maxLength:2000}});
|
||||||
var str = ""
|
if (stderr) msg.channel.send(stderr, {split:{char:'',maxLength:2000}});
|
||||||
if (stdout) msg.channel.send(stdout, {split:{char:''}});
|
|
||||||
if (stderr) msg.channel.send(stderr, {split:{char:''}});
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
"query": {
|
"query": {
|
||||||
|
|
Loading…
Reference in New Issue