mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-03-16 14:11:50 +00:00
Implemented loading and finished message
This commit is contained in:
parent
c576d9a37c
commit
59a7e51b63
1 changed files with 8 additions and 3 deletions
|
@ -326,6 +326,9 @@ export class MutesPlugin extends ZeppelinPlugin<IMutesPluginConfig> {
|
||||||
protected async muteListCmd(msg: Message, args: { age?: number; left?: boolean }) {
|
protected async muteListCmd(msg: Message, args: { age?: number; left?: boolean }) {
|
||||||
const lines = [];
|
const lines = [];
|
||||||
|
|
||||||
|
// Create a loading message as this can potentially take some time
|
||||||
|
const loadingMessage = await msg.channel.createMessage("Loading mutes...");
|
||||||
|
|
||||||
// Active, logged mutes
|
// Active, logged mutes
|
||||||
const activeMutes = await this.mutes.getActiveMutes();
|
const activeMutes = await this.mutes.getActiveMutes();
|
||||||
activeMutes.sort((a, b) => {
|
activeMutes.sort((a, b) => {
|
||||||
|
@ -430,9 +433,7 @@ export class MutesPlugin extends ZeppelinPlugin<IMutesPluginConfig> {
|
||||||
|
|
||||||
lines.push(
|
lines.push(
|
||||||
...manuallyMutedMembers.map(member => {
|
...manuallyMutedMembers.map(member => {
|
||||||
return `<@!${member.id}> (**${member.user.username}#${member.user.discriminator}**, \`${
|
return `<@!${member.id}> (**${member.user.username}#${member.user.discriminator}**, \`${member.id}\`) 🔧 Manual mute`;
|
||||||
member.id
|
|
||||||
}\`) 🔧 Manual mute`;
|
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -446,10 +447,14 @@ export class MutesPlugin extends ZeppelinPlugin<IMutesPluginConfig> {
|
||||||
message = hasFilters ? "No mutes found with the specified filters!" : "No active mutes!";
|
message = hasFilters ? "No mutes found with the specified filters!" : "No active mutes!";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
await loadingMessage.delete();
|
||||||
const chunks = chunkMessageLines(message);
|
const chunks = chunkMessageLines(message);
|
||||||
for (const chunk of chunks) {
|
for (const chunk of chunks) {
|
||||||
msg.channel.createMessage(chunk);
|
msg.channel.createMessage(chunk);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// let the user know we are done
|
||||||
|
msg.channel.createMessage(successMessage("All mutes for the specified filters posted!"));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue