mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-03-16 22:21:51 +00:00
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,
|
configType: t.boolean,
|
||||||
defaultConfig: false,
|
defaultConfig: false,
|
||||||
|
|
||||||
async apply({ pluginData, contexts }) {
|
async apply({ pluginData, contexts, ruleName }) {
|
||||||
const messageIdsToDeleteByChannelId: Map<string, string[]> = new Map();
|
const messageIdsToDeleteByChannelId: Map<string, string[]> = new Map();
|
||||||
for (const context of contexts) {
|
for (const context of contexts) {
|
||||||
if (context.message) {
|
if (context.message) {
|
||||||
|
@ -14,6 +14,11 @@ export const CleanAction = automodAction({
|
||||||
messageIdsToDeleteByChannelId.set(context.message.channel_id, []);
|
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);
|
messageIdsToDeleteByChannelId.get(context.message.channel_id).push(context.message.id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue