aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar ChrisJL <[email protected]>2024-04-01 12:56:20 +0100
committerGravatar GitHub <[email protected]>2024-04-01 12:56:20 +0100
commitd9ab46f4ee977c97f69b903730fca875854ca951 (patch)
treecea94868b6fdafffd897eb800dccda9006ce6131
parentMerge pull request #2989 from python-discord/jb3/voice-gate-log-2922 (diff)
Allow extra channels to be ignored by the duck pond cog (#2990)
We want to be able to expand the list of channels ignored by duckpond, without having to add the entire list of default channels first.
-rw-r--r--bot/constants.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/bot/constants.py b/bot/constants.py
index 0250d0e31..a9e192c52 100644
--- a/bot/constants.py
+++ b/bot/constants.py
@@ -8,7 +8,7 @@ By default, the values defined in the classes are used, these can be overridden
import os
from enum import Enum
-from pydantic import BaseModel
+from pydantic import BaseModel, computed_field
from pydantic_settings import BaseSettings
@@ -322,7 +322,7 @@ class _DuckPond(EnvConfig, env_prefix="duck_pond_"):
threshold: int = 7
- channel_blacklist: tuple[int, ...] = (
+ default_channel_blacklist: tuple[int, ...] = (
Channels.announcements,
Channels.python_news,
Channels.python_events,
@@ -336,6 +336,12 @@ class _DuckPond(EnvConfig, env_prefix="duck_pond_"):
Channels.staff_info,
)
+ extra_channel_blacklist: tuple[int, ...] = tuple()
+
+ @computed_field
+ @property
+ def channel_blacklist(self) -> tuple[int, ...]:
+ return self.default_channel_blacklist + self.extra_channel_blacklist
DuckPond = _DuckPond()