f0ckv1/src/trigger/thumb.js

21 lines
559 B
JavaScript
Raw Normal View History

2016-08-24 17:15:14 +00:00
var fs = require('fs-extra');
module.exports = (bot, trigger, lib) => {
trigger.add({
name: 'thumbnailer',
2016-08-24 20:02:20 +00:00
call: /^\!thumb (\d+)$/i,
2016-08-24 17:15:14 +00:00
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'
});
};