f0ckv1/src/trigger/thumb.js
2016-08-24 22:02:20 +02:00

21 lines
559 B
JavaScript

var fs = require('fs-extra');
module.exports = (bot, trigger, lib) => {
trigger.add({
name: 'thumbnailer',
call: /^\!thumb (\d+)$/i,
level: 100,
active: 1,
func: (e) => {
var id = e.message.split(' ')[1];
if(Number.isInteger(parseInt(id))) {
fs.unlink('./t/'+id+'.png', () => {
//e.reply('debug: Thumbnail gelöscht');
lib.generateThumbs();
//e.reply('debug: sollte Thumbnail generiert haben');
});
}
},
desc: 'regenerate thumbnail'
});
};