f0ckv1/src/trigger/thumb.js

21 lines
577 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',
call: new RegExp('^\\!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'
});
};