Debug++
This commit is contained in:
parent
f6d55f1060
commit
def8e037ef
1 changed files with 6 additions and 1 deletions
|
@ -6,7 +6,7 @@ export const CleanAction = automodAction({
|
|||
configType: t.boolean,
|
||||
defaultConfig: false,
|
||||
|
||||
async apply({ pluginData, contexts }) {
|
||||
async apply({ pluginData, contexts, ruleName }) {
|
||||
const messageIdsToDeleteByChannelId: Map<string, string[]> = new Map();
|
||||
for (const context of contexts) {
|
||||
if (context.message) {
|
||||
|
@ -14,6 +14,11 @@ export const CleanAction = automodAction({
|
|||
messageIdsToDeleteByChannelId.set(context.message.channel_id, []);
|
||||
}
|
||||
|
||||
if (messageIdsToDeleteByChannelId.get(context.message.channel_id).includes(context.message.id)) {
|
||||
console.warn(`Message ID to delete was already present: ${pluginData.guild.name}, rule ${ruleName}`);
|
||||
continue;
|
||||
}
|
||||
|
||||
messageIdsToDeleteByChannelId.get(context.message.channel_id).push(context.message.id);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue