From 69c06537e2249382cfe41d0c9cd48aaadce5052f Mon Sep 17 00:00:00 2001 From: reality Date: Fri, 23 Feb 2018 12:30:18 +0000 Subject: [PATCH] sustatus alsuti --- modules/report/commands.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/modules/report/commands.js b/modules/report/commands.js index 2e94d73..98bd571 100644 --- a/modules/report/commands.js +++ b/modules/report/commands.js @@ -1,6 +1,7 @@ var _ = require('underscore')._, moment = require('moment'), - async = require('async'); + async = require('async'), + exec = require('child_process').exec; var commands = function(dbot) { var commands = { @@ -173,6 +174,11 @@ var commands = function(dbot) { return event.reply('~_~ do that in #moderators ~_~'); } + function puts(error, stdout, stderr) { + var res = stdout.split('\n'); + event.reply('Link: ' + res[res.length-3]); + } + dbot.api.users.resolveUser(event.server, user, function(err, user) { if(user) { dbot.api.users.getUserAliases(user.id, function(err, aliases) { @@ -250,7 +256,9 @@ var commands = function(dbot) { n++; } }); + exec("/home/node/alsuti/bin/alsuti -p "+randomString(12, '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ')+" /tmp/"+user.id+'dd.txt', puts); } else { + exec("/home/node/alsuti/bin/alsuti -p "+randomString(12, '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ')+" /tmp/"+user.id+'dd.txt', puts); event.reply('There are too many to show without killing everyone :S'); }