From e3a7a8fe9c1afe06d7758728681238da4beb7bb1 Mon Sep 17 00:00:00 2001 From: Loic Bersier Date: Thu, 22 Nov 2018 20:35:57 +0100 Subject: [PATCH] fixed it hopefully --- commands/fun/print.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/commands/fun/print.js b/commands/fun/print.js index f15d7fb1..c2dbfee0 100644 --- a/commands/fun/print.js +++ b/commands/fun/print.js @@ -8,7 +8,7 @@ module.exports = class printCommand extends Command { aliases: ['dundermiffline', 'wastedevinkandmoney'], group: 'fun', memberName: 'print', - description: 'print whatever you want using the dev printer ! ( yea really, send a feedback requesting the image and i\'il send it to you.', + description: 'print whatever you want using the dev printer ! ( yea really, send a feedback requesting the image and i\'il send it to you. )', throttling: { usages: 1, duration: 86400, @@ -24,15 +24,19 @@ module.exports = class printCommand extends Command { } async run(message, { text }) { + const channel = this.client.channels.get(printChannel); + + printer.printDirect({data:`Printed by: ${message.author.username}\n\n${text}` , type: 'TEXT' // type: RAW, TEXT, PDF, JPEG, .. depends on platform , success:function(jobID){ console.log("sent to printer with ID: "+jobID); message.say("Printing now! ( You will receive your print shortly ( if the dev isint sleeping that is ))"); - const channel = this.client.channels.get(printChannel); - channel.send(`${message.author.username} (${message.author.id}) Asked for a print with the following text: ${text}`); } , error:function(err){console.log(err); message.say("An error has occured, the printer is most likely disconnected, try again later")} }); + +channel.send(`${message.author.username} (${message.author.id}) Asked for a print with the following text: ${text}`); + } }; \ No newline at end of file