Add exclude_bots option to log channels
This commit is contained in:
parent
2650ab81a5
commit
d65f5b99d7
2 changed files with 10 additions and 0 deletions
|
@ -20,6 +20,7 @@ const LogChannel = t.partial({
|
|||
excluded_message_regexes: t.array(TRegex),
|
||||
excluded_channels: t.array(t.string),
|
||||
excluded_categories: t.array(t.string),
|
||||
exclude_bots: t.boolean,
|
||||
format: tNullable(tLogFormats),
|
||||
timestamp_format: t.string,
|
||||
include_embed_timestamp: t.boolean,
|
||||
|
|
|
@ -27,6 +27,15 @@ export async function log(pluginData: GuildPluginData<LogsPluginType>, type: Log
|
|||
}
|
||||
}
|
||||
|
||||
// If we're excluding bots and the logged user is a bot, skip it
|
||||
if (opts.exclude_bots) {
|
||||
for (const prop of excludedUserProps) {
|
||||
if (data && data[prop] && data[prop].bot) {
|
||||
continue logChannelLoop;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If this entry is from an excluded channel, skip it
|
||||
if (opts.excluded_channels) {
|
||||
if (
|
||||
|
|
Loading…
Add table
Reference in a new issue