mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-03-16 14:11:50 +00:00
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,
|
count: savedMessages.length,
|
||||||
archiveUrl,
|
archiveUrl,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
return { archiveUrl };
|
||||||
}
|
}
|
||||||
|
|
||||||
@d.command("clean", "<count:number>", {
|
@d.command("clean", "<count:number>", {
|
||||||
|
@ -706,10 +708,12 @@ export class UtilityPlugin extends ZeppelinPlugin<TConfigSchema> {
|
||||||
|
|
||||||
let responseMsg: Message;
|
let responseMsg: Message;
|
||||||
if (messagesToClean.length > 0) {
|
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"}`;
|
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));
|
responseMsg = await msg.channel.createMessage(successMessage(responseText));
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Reference in a new issue