feat(aurora): updated phx-class-registry to ^5.0.0 and fixed some typos
Some checks failed
Actions / Build Documentation (MkDocs) (pull_request) Successful in 30s
Actions / Lint Code (Ruff & Pylint) (pull_request) Failing after 54s

This commit is contained in:
cswimr 2024-09-20 14:49:28 -04:00
parent 405729f37d
commit 97406e7bac
Signed by: cswimr
GPG key ID: 456E21B886A39061
5 changed files with 694 additions and 647 deletions

View file

@ -1,14 +1,15 @@
from abc import abstractmethod
from abc import ABC, abstractmethod
from typing import Any, Dict, Tuple
from class_registry import AutoRegister, ClassRegistry
from class_registry import ClassRegistry
from class_registry.base import AutoRegister
from discord import Interaction, Member, User
from discord.abc import Messageable
from redbot.core import commands
type_registry: Dict['str', 'Type'] = ClassRegistry(attr_name='key', unique=True)
class Type(metaclass=AutoRegister(type_registry)):
class Type(AutoRegister(type_registry), ABC):
"""This is a base class for moderation types.
Attributes:
@ -16,7 +17,7 @@ class Type(metaclass=AutoRegister(type_registry)):
string (str): The string to display for this type.
verb (str): The verb to use for this type.
embed_desc (str): The string to use for embed descriptions.
channel (bool): Whether this type targets channels or users. If this is `true` in a subclass, its overriden handler methods should be typed with `discord.abc.Messageable` instead of `discord.Member | discord.User`.
channel (bool): Whether this type targets channels or users. If this is `true` in a subclass, its overridden handler methods should be typed with `discord.abc.Messageable` instead of `discord.Member | discord.User`.
removes_from_guild (bool): Whether this type's handler removes the target from the guild, or if the moderation is expected to occur whenever the user is not in the guild. This does not actually remove the target from the guild, the handler method is responsible for that.
Properties: