if(awaitclient.punishments._content.findById(caseId))awaitinteraction.reply({embeds:[newclient.embed().setColor(client.config.embedColorGreen).setTitle('Case updated').setDescription(`Case #${caseId} has been successfully updated with new reason:\n\`${reason}\``)]});
elseinteraction.reply({embeds:[newclient.embed().setColor(client.config.embedColorRed).setTitle('Case not updated').setDescription(`Case #${caseId} is not stored on database, not updating the reason.`)]});
constembed=newclient.embed().setColor(client.config.embedColor).setTimestamp(punishment.time).setTitle(`${punishment.type[0].toUpperCase()+punishment.type.slice(1)} | Case #${punishment.id}`).addFields(
if(punishment.expired)embed.addFields({name:'🔹 Expired',value:`This case has been overwritten by Case #${cancelledBy.id} for reason \`${cancelledBy.reason}\``})
if(punishment.cancels)embed.addFields({name:'🔹 Overwrites',value:`This case overwrites Case #${cancels.id} with reason \`${cancels.reason}\``})
value:`Reason: \`${punishment.reason}\`\n${punishment.duration?`Duration: ${FormatTime(punishment.duration,3)}\n`:''}Moderator: <@${punishment.moderator}>${punishment.expired?`\nOverwritten by Case #${punishments.find(x=>x.cancels===punishment._id)?._id}`:''}${punishment.cancels?`\nOverwrites Case #${punishment.cancels}`:''}`
returninteraction.reply({embeds:[newclient.embed().setColor(client.config.embedColor).setTitle(`${user.username}'s punishment history`).setDescription(`**ID:** \`${user.id}\``).setFooter({text:`${userPunishment.length} total punishments. Viewing page ${pageNum} out of ${Math.ceil(userPunishment.length/6)}.`}).addFields(userPunishment.slice((pageNum-1)*6,pageNum*6))]});