forked from Supositware/Haha-Yes
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
1.1 KiB
JavaScript
35 lines
1.1 KiB
JavaScript
6 years ago
|
const { Command } = require('discord.js-commando');
|
||
|
const printer = require('printer');
|
||
|
module.exports = class printCommand extends Command {
|
||
|
constructor(client) {
|
||
|
super(client, {
|
||
|
name: 'print',
|
||
6 years ago
|
group: 'fun',
|
||
6 years ago
|
memberName: 'print',
|
||
6 years ago
|
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,
|
||
|
},
|
||
6 years ago
|
args: [
|
||
|
{
|
||
|
key: 'text',
|
||
6 years ago
|
prompt: 'What do you want to print? ( text only )',
|
||
6 years ago
|
type: 'string',
|
||
|
}
|
||
|
]
|
||
|
});
|
||
|
}
|
||
|
|
||
|
async run(message, { text }) {
|
||
|
printer.printDirect({data:text, printer:'HP-Color-LaserJet-CM1312-MFP'
|
||
|
, type: 'TEXT' // type: RAW, TEXT, PDF, JPEG, .. depends on platform
|
||
|
, success:function(jobID){
|
||
|
console.log("sent to printer with ID: "+jobID);
|
||
|
}
|
||
|
, error:function(err){console.log(err);}
|
||
|
});
|
||
6 years ago
|
|
||
|
message.say("Printing now!")
|
||
6 years ago
|
}
|
||
|
};
|