From 00ce6de8d9b85249c996291e65a99b397c838e02 Mon Sep 17 00:00:00 2001 From: Supositware Date: Sun, 31 Mar 2019 00:39:36 +0100 Subject: [PATCH] put stdout and stderr in embed --- commands/owner/update.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/commands/owner/update.js b/commands/owner/update.js index ad69a47..a3c9ac1 100644 --- a/commands/owner/update.js +++ b/commands/owner/update.js @@ -1,6 +1,7 @@ const { Command } = require('discord-akairo'); const util = require('util'); const exec = util.promisify(require('child_process').exec); +const { MessageEmbed } = require('discord.js'); class EvalCommand extends Command { constructor() { @@ -19,8 +20,10 @@ class EvalCommand extends Command { async exec(message) { async function update() { const { stdout, stderr } = await exec('git pull'); - message.channel.send(stdout); - message.channel.send(stderr); + const Embed = new MessageEmbed() + .addField('stdout', stdout) + .addField('stderr', stderr); + message.channel.send({embed: Embed}); console.log(`stdout: ${stdout}`); console.log(`stderr: ${stderr}`); }