3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-15 05:41:51 +00:00

utility: reply with archive url when !cleaning other channels

This commit is contained in:
Dragory 2019-11-30 22:22:25 +02:00
parent 53e7c2f17d
commit 23a9a5e800

View file

@ -594,6 +594,8 @@ export class UtilityPlugin extends ZeppelinPlugin<TConfigSchema> {
count: savedMessages.length,
archiveUrl,
});
return { archiveUrl };
}
@d.command("clean", "<count:number>", {
@ -706,10 +708,12 @@ export class UtilityPlugin extends ZeppelinPlugin<TConfigSchema> {
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 {