utility: reply with archive url when !cleaning other channels
This commit is contained in:
parent
53e7c2f17d
commit
23a9a5e800
1 changed files with 6 additions and 2 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Reference in a new issue