forked from Supositware/Haha-Yes
put stdout and stderr in embed
This commit is contained in:
parent
fd12f4a373
commit
00ce6de8d9
1 changed files with 5 additions and 2 deletions
|
@ -1,6 +1,7 @@
|
||||||
const { Command } = require('discord-akairo');
|
const { Command } = require('discord-akairo');
|
||||||
const util = require('util');
|
const util = require('util');
|
||||||
const exec = util.promisify(require('child_process').exec);
|
const exec = util.promisify(require('child_process').exec);
|
||||||
|
const { MessageEmbed } = require('discord.js');
|
||||||
|
|
||||||
class EvalCommand extends Command {
|
class EvalCommand extends Command {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
@ -19,8 +20,10 @@ class EvalCommand extends Command {
|
||||||
async exec(message) {
|
async exec(message) {
|
||||||
async function update() {
|
async function update() {
|
||||||
const { stdout, stderr } = await exec('git pull');
|
const { stdout, stderr } = await exec('git pull');
|
||||||
message.channel.send(stdout);
|
const Embed = new MessageEmbed()
|
||||||
message.channel.send(stderr);
|
.addField('stdout', stdout)
|
||||||
|
.addField('stderr', stderr);
|
||||||
|
message.channel.send({embed: Embed});
|
||||||
console.log(`stdout: ${stdout}`);
|
console.log(`stdout: ${stdout}`);
|
||||||
console.log(`stderr: ${stderr}`);
|
console.log(`stderr: ${stderr}`);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue