diff --git a/structure/client/components/commands/moderation/History.js b/structure/client/components/commands/moderation/History.js index 208b75b..757427c 100644 --- a/structure/client/components/commands/moderation/History.js +++ b/structure/client/components/commands/moderation/History.js @@ -97,7 +97,8 @@ class HistoryCommand extends Command { async execute(message, { params, args }) { - if(args.export) return this._exportLogs(message, Boolean(args.private)); + const priv = Boolean(args.private); + if(args.export) return this._exportLogs(message, priv); const query = { guild: message.guild.id @@ -180,17 +181,24 @@ class HistoryCommand extends Command { for(let i = 0; i `<@&${r}>`).join(' ') + })}`; + } + if(infraction.duration) string += `\n**Duration:** ${Util.duration(infraction.duration)}`; if(infraction.points) string += `\n**Points:** ${infraction.points}`; @@ -207,17 +215,23 @@ class HistoryCommand extends Command { if(long) embed.footer.text += ` • To see the full reason, use the ${message.guild.prefix}case command.`; const type = message.format('C_HISTORY_SUCCESSTYPE', { old: Boolean(args.oldest) }, true); - message.respond(message.format('C_HISTORY_SUCCESS', { - targets: parsed.length > 0 ? message.format('C_HISTORY_SUCCESSTARGETS', { - plural: parsed.length === 1 ? '' : 's', - targets: parsed.map((p) => `**${Util.escapeMarkdown(p.display)}**`).join(' ') - }) : '', - type - }), { - emoji: 'success', - embed, - dm: Boolean(args.private) - }); + try { + message.respond(message.format('C_HISTORY_SUCCESS', { + targets: parsed.length > 0 ? message.format('C_HISTORY_SUCCESSTARGETS', { + plural: parsed.length === 1 ? '' : 's', + targets: parsed.map((p) => `**${Util.escapeMarkdown(p.display)}**`).join(' ') + }) : '', + type + }), { + emoji: 'success', + embed, + dm: Boolean(args.private) + }); + } catch(e) { //eslint-disable-line no-unused-vars + message.respond(message.format('C_HISTORY_FAILTOOLONG'), { + emoji: 'failure' + }); + } }