constembed=newclient.embed().setColor(client.config.embedColorGreen).setTitle('Case updated').setDescription(`Case #${caseId} has been successfully updated with new reason:\n\`${reason}\``);
constembed=newclient.embed().setColor(client.config.embedColor).setTimestamp(punishment.time).setTitle(`${client.formatPunishmentType(punishment,client,cancels)} | 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}\``})
interaction.reply({embeds:[embed]});
}else{
// if caseid is user id, show their punishment history sorted by most recent.
name:`${client.formatPunishmentType(punishment,client,cancels)} | Case #${punishment.id}`,
value:`Reason: \`${punishment.reason}\`\n${punishment.duration?`Duration: ${client.formatTime(punishment.duration,3)}\n`:''}Moderator: <@${punishment.moderator}>${punishment.expired?`\nOverwritten by case #${client.punishments._content.find((x:Punishment)=>x.cancels==punishment.id).id}`:''}${punishment.cancels?`\nOverwrites case #${punishment.cancels}`:''}`
}
});
// if caseid is not a punishment nor a user, failed
if(!userPunishment||userPunishment.length==0)returninteraction.reply('No punishments found for that case # or User ID');
constembed=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));