From 23a9a5e800e92db7d802c558c675955df1889e3b Mon Sep 17 00:00:00 2001 From: Dragory <2606411+Dragory@users.noreply.github.com> Date: Sat, 30 Nov 2019 22:22:25 +0200 Subject: [PATCH] utility: reply with archive url when !cleaning other channels --- backend/src/plugins/Utility.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/backend/src/plugins/Utility.ts b/backend/src/plugins/Utility.ts index 0af2ef5b..0e438c8f 100644 --- a/backend/src/plugins/Utility.ts +++ b/backend/src/plugins/Utility.ts @@ -594,6 +594,8 @@ export class UtilityPlugin extends ZeppelinPlugin { count: savedMessages.length, archiveUrl, }); + + return { archiveUrl }; } @d.command("clean", "", { @@ -706,10 +708,12 @@ export class UtilityPlugin extends ZeppelinPlugin { let responseMsg: Message; if (messagesToClean.length > 0) { - await this.cleanMessages(targetChannel, messagesToClean, msg.author); + const cleanResult = await this.cleanMessages(targetChannel, messagesToClean, msg.author); let responseText = `Cleaned ${messagesToClean.length} ${messagesToClean.length === 1 ? "message" : "messages"}`; - if (targetChannel.id !== msg.channel.id) responseText += ` in <#${targetChannel.id}>`; + if (targetChannel.id !== msg.channel.id) { + responseText += ` in <#${targetChannel.id}>\n${cleanResult.archiveUrl}`; + } responseMsg = await msg.channel.createMessage(successMessage(responseText)); } else {