fix(logs): fix inconsistent thread/channel/category exclusions; add excluded_threads log channel option
This commit is contained in:
parent
218c31231e
commit
d472fd4fa6
32 changed files with 132 additions and 51 deletions
|
@ -22,6 +22,7 @@ interface ExclusionData {
|
|||
roles?: Snowflake[] | null;
|
||||
channel?: Snowflake | null;
|
||||
category?: Snowflake | null;
|
||||
thread?: Snowflake | null;
|
||||
messageTextContent?: string | null;
|
||||
}
|
||||
|
||||
|
@ -58,6 +59,10 @@ async function shouldExclude(
|
|||
return true;
|
||||
}
|
||||
|
||||
if (opts.excluded_threads && exclusionData.thread && opts.excluded_threads.includes(exclusionData.thread)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (opts.excluded_message_regexes && exclusionData.messageTextContent) {
|
||||
for (const regex of opts.excluded_message_regexes) {
|
||||
const matches = await pluginData.state.regexRunner
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue