fix(aurora): fixed some stuff up
Some checks failed
Actions / Build Documentation (MkDocs) (pull_request) Failing after 27s
Actions / Lint Code (Ruff & Pylint) (pull_request) Failing after 42s

This commit is contained in:
Seaswimmer 2024-07-06 12:23:06 -04:00
parent 54ac77ceb9
commit bf945ec9f1
Signed by: cswimr
GPG key ID: 3813315477F26F82
4 changed files with 14 additions and 10 deletions

View file

@ -313,7 +313,7 @@ class Moderation(AuroraGuildModel):
bot: Red,
guild_id: int,
moderator_id: int,
moderation_type: str,
moderation_type: Type,
target_type: str,
target_id: int,
role_id: int | None = None,
@ -373,7 +373,7 @@ class Moderation(AuroraGuildModel):
case = {
"moderation_id": moderation_id,
"timestamp": timestamp.timestamp(),
"moderation_type": moderation_type,
"moderation_type": moderation_type.key,
"target_type": target_type,
"target_id": target_id,
"moderator_id": moderator_id,

View file

@ -21,7 +21,8 @@ def get_icon(bot: Red) -> File:
@type_registry.register(key="ban")
class Ban(Type):
moderation_type="ban"
key="ban"
string="ban"
verb="banned"
@classmethod
@ -62,7 +63,7 @@ class Ban(Type):
bot,
ctx.guild.id,
ctx.author.id,
cls.moderation_type,
cls(),
'user',
target.id,
None,
@ -99,7 +100,8 @@ class Ban(Type):
@type_registry.register(key="tempban")
class Tempban(Ban):
moderation_type="tempban"
key="tempban"
string="tempban"
verb="tempbanned"
@classmethod
@ -148,7 +150,7 @@ class Tempban(Ban):
bot,
ctx.guild.id,
ctx.author.id,
cls.moderation_type,
cls(),
'user',
target.id,
None,

View file

@ -6,13 +6,15 @@ from redbot.core import commands
from redbot.core.bot import Red
#@type_registry.register(key="type")
class Type(object):
moderation_type = None
verb = None
key = "type" # this should ALWAYS be the same as the registry key, and should NEVER be localized
string = "type"
verb = "typed"
embed_desc = "been"
def __str__(self) -> str:
return self.moderation_type
return self.string
@classmethod
async def handler(cls, ctx: commands.Context, target: Member | User, silent: bool, **kwargs) -> 'Type': # pylint: disable=unused-argument

View file

@ -42,7 +42,7 @@ async def message_factory(
Returns:
embed: The message embed.
"""
if response is not None and moderation_type.moderation_type not in [
if response is not None and moderation_type.key not in [
"kick",
"ban",
"tempban",