update command

This commit is contained in:
codepupper 2019-11-16 18:13:24 +01:00
parent e8d656143c
commit cc476832ab
2 changed files with 36 additions and 1 deletions

View file

@ -0,0 +1,34 @@
const Command = require('../../src/structures/Command');
const exec = require('shell-exec');
module.exports = class Update extends Command {
constructor() {
super({
name: 'update',
description: 'Execute shell commands',
aliases: [ 'up', 'pull' ],
module: 'Developers',
cooldown: 1,
guildOnly: false,
developerOnly: true,
nsfw: false
});
}
async command(ctx) {
const trying = await ctx.send(
`${ctx.utils.emotes.random.loading} Getting the latest updates from ${ctx.config.source.replace(
'https://',
''
)} ${ctx.utils.emotes.random.loading}`
);
await exec('git pull')
.then((r) => {
trying.edit('```fix\n' + r.stdout + '```');
})
.catch((error) => {
trying.edit(`Failed to get the latest updates.`);
console.error(error);
});
}
};

View file

@ -71,6 +71,7 @@ module.exports = {
dubai: 'Dubai'
},
random: {
pin: '<:pin:350172480725581838>'
pin: '<:pin:350172480725581838>',
loading: '<a:loading:645308535390994432>'
}
};