blob: 899dac67985f63a270bd4e86f901bc7256406e0f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
const exec = require('child_process').exec;
module.exports.loadModule = function loadModule(bot) {
bot.handler.endpoint('^v(?:ersion)?$', [], (match, message) => {
exec('git rev-list --count HEAD', (error, stdout) => {
if (error) {
bot.createMessage(message.channel.id, 'An error has occured').catch(Logger.error);
return;
}
exec('git log -1 --pretty=%B', (error2, stdout2) => {
let msg = `Commit number ${stdout}`;
if (!error2) {
msg += `\n\`\`\`\n${stdout2}\`\`\``;
}
bot.createMessage(message.channel.id, msg).catch(Logger.error);
});
});
});
};
|