make update message better

This commit is contained in:
derpystuff 2022-06-17 22:06:47 +02:00
parent 321079d991
commit 3559e1a6ec
2 changed files with 4 additions and 2 deletions

View file

@ -24,11 +24,13 @@ module.exports = {
await context.triggerTyping(); await context.triggerTyping();
let response = await editOrReply(context, createEmbed("loading", context, "Updating bot...")) let response = await editOrReply(context, createEmbed("loading", context, "Updating bot..."))
try{ try{
const t = Date.now()
const r = execSync("git pull") const r = execSync("git pull")
if(r.toString().includes("Already up to date.")) return await response.edit({embeds: [createEmbed("warning", context, "Already up to date.")]}) if(r.toString().includes("Already up to date.")) return await response.edit({embeds: [createEmbed("warning", context, "Already up to date.")]})
let id = r.toString().match(/(?:.*?)\.\.([a-z0-9]{7})/)[1] let id = r.toString().match(/(?:.*?)\.\.([a-z0-9]{7})/)[1]
return await response.edit({embeds: [createEmbed("default", context, {description: `Update complete (${highlight(id)})`})]}) return await response.edit({embeds: [createEmbed("success", context, `Updated to ${id} in ${((Date.now() - timings) / 1000).toFixed(2)}s`)]})
}catch(e){ }catch(e){
console.log(e) console.log(e)
return await response.edit({embeds: [createEmbed("error", context, "Update failed.")]}) return await response.edit({embeds: [createEmbed("error", context, "Update failed.")]})

View file

@ -20,7 +20,7 @@ const embedTypes = Object.freeze({
"success": (context) => { "success": (context) => {
return { return {
author: { author: {
name: `Error` name: `Success`
}, },
color: COLORS.success color: COLORS.success
} }