Skip to content

Commit

Permalink
Rewrite Pronouns module (#207)
Browse files Browse the repository at this point in the history
  • Loading branch information
No767 authored Oct 3, 2024
1 parent 4757628 commit 94471b5
Show file tree
Hide file tree
Showing 17 changed files with 755 additions and 712 deletions.
9 changes: 7 additions & 2 deletions bot/catherinecore.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
from aiohttp import ClientSession
from cogs import EXTENSIONS, VERSION
from cogs.ext import prometheus
from cogs.pronouns import ApprovePronounsExampleView
from discord.ext import commands
from libs.ui.pronouns import ApprovePronounsExampleView
from libs.utils.config import Blacklist, CatherineConfig
from libs.utils.reloader import Reloader
from libs.utils.tree import CatherineCommandTree
Expand Down Expand Up @@ -41,11 +41,16 @@ def __init__(
self.session = session
self.pool = pool
self.version = str(VERSION)
self._config = config
self._dev_mode = config.bot.get("dev_mode", False)
self._reloader = Reloader(self, Path(__file__).parent)
self._prometheus = config.bot.get("prometheus", {})
self._prometheus_enabled = self._prometheus.get("enabled", False)

@property
def approval_channel_id(self) -> int:
return self._config.bot["approval_channel_id"]

async def add_to_blacklist(self, object_id: int):
await self.blacklist.put(object_id, True)

Expand All @@ -62,7 +67,7 @@ async def on_command_error(
return

async def setup_hook(self) -> None:
self.add_view(ApprovePronounsExampleView("", 0, 10, self.pool))
self.add_view(ApprovePronounsExampleView(self, "", 0, 10))

for cog in EXTENSIONS:
self.logger.debug(f"Loaded extension: {cog}")
Expand Down
Loading

0 comments on commit 94471b5

Please sign in to comment.