aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--config-default.toml14
-rw-r--r--metricity/config.py13
-rw-r--r--metricity/exts/event_listeners/guild_listeners.py5
3 files changed, 21 insertions, 11 deletions
diff --git a/config-default.toml b/config-default.toml
index 60374ef..de8290b 100644
--- a/config-default.toml
+++ b/config-default.toml
@@ -29,13 +29,23 @@ staff_categories = [
721459859500957726,
430484673248886784,
749736277464842262,
- 749735995460550726
+ 749735995460550726,
+ 787641585624940544,
+ 412287621704843264,
+ 881573419878076456,
+ 820711852652494868
+]
+
+# Channels that should be flagged as staff only by channel ID
+staff_channels =[
+ 412375055910043655
]
# Don't report messages for the following categories
ignore_categories = [
714494672835444826,
- 890331800025563216
+ 890331800025563216,
+ 895417395261341766
]
[database]
diff --git a/metricity/config.py b/metricity/config.py
index 5a57d59..99fd0c2 100644
--- a/metricity/config.py
+++ b/metricity/config.py
@@ -2,7 +2,7 @@
import logging
from os import environ
from pathlib import Path
-from typing import Any, Dict, List, Optional, Tuple
+from typing import Any, Optional
import toml
from deepmerge import Merger
@@ -17,7 +17,7 @@ class MetricityConfigurationError(Exception):
"""Exception signifying something has gone awry whilst parsing Metricity config."""
-def get_section(section: str) -> Dict[str, Any]:
+def get_section(section: str) -> dict[str, Any]:
"""
Load the section config from config-default.toml and config.toml.
@@ -64,8 +64,8 @@ class ConfigSection(type):
def __new__(
cls: type,
name: str,
- bases: Tuple[type],
- dictionary: Dict[str, Any]
+ bases: tuple[type],
+ dictionary: dict[str, Any]
) -> type:
"""Use the section attr in the subclass to fill in the values from the TOML."""
config = get_section(dictionary["section"])
@@ -114,8 +114,9 @@ class BotConfig(metaclass=ConfigSection):
guild_id: int
staff_role_id: int
- staff_categories: List[int]
- ignore_categories: List[int]
+ staff_categories: list[int]
+ staff_channels: list[int]
+ ignore_categories: list[int]
class DatabaseConfig(metaclass=ConfigSection):
diff --git a/metricity/exts/event_listeners/guild_listeners.py b/metricity/exts/event_listeners/guild_listeners.py
index 18eb79a..67b20bc 100644
--- a/metricity/exts/event_listeners/guild_listeners.py
+++ b/metricity/exts/event_listeners/guild_listeners.py
@@ -92,9 +92,8 @@ class GuildListeners(commands.Cog):
if not isinstance(channel, discord.CategoryChannel):
category_id = str(channel.category.id) if channel.category else None
# Cast to bool so is_staff is False if channel.category is None
- is_staff = bool(
- channel.category
- and channel.category.id in BotConfig.staff_categories
+ is_staff = channel.id in BotConfig.staff_channels or bool(
+ channel.category and channel.category.id in BotConfig.staff_categories
)
if db_chan := await models.Channel.get(str(channel.id)):
await db_chan.update(