WIP: Refactor Aurora (3.0.0) #29
3 changed files with 3 additions and 4 deletions
|
@ -1,3 +1,4 @@
|
||||||
|
# pylint: disable=abstract-method
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
from math import ceil
|
from math import ceil
|
||||||
from time import time
|
from time import time
|
||||||
|
@ -787,7 +788,7 @@ class Tempban(Ban):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
async def handler(cls, ctx: commands.Context, target: Member | User, silent: bool, duration: str, reason: str = None, delete_messages: app_commands.Choice | None = None) -> 'Ban':
|
async def handler(cls, ctx: commands.Context, target: Member | User, silent: bool, duration: str, reason: str = None, delete_messages: app_commands.Choice | None = None) -> 'Ban': # pylint: disabled=arguments-renamed
|
||||||
"""Ban a user."""
|
"""Ban a user."""
|
||||||
bot = ctx.bot
|
bot = ctx.bot
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -8,7 +8,7 @@ from redbot.core import commands
|
||||||
|
|
||||||
type_registry: List['Type'] = ClassRegistry(attr_name='key', unique=True)
|
type_registry: List['Type'] = ClassRegistry(attr_name='key', unique=True)
|
||||||
|
|
||||||
class Type(object, metaclass=AutoRegister(type_registry)):
|
class Type(metaclass=AutoRegister(type_registry)):
|
||||||
"""This is a base class for moderation types.
|
"""This is a base class for moderation types.
|
||||||
|
|
||||||
Attributes:
|
Attributes:
|
||||||
|
|
|
@ -23,7 +23,6 @@ async def message_factory(
|
||||||
moderator: Union[Member, User] | None = None,
|
moderator: Union[Member, User] | None = None,
|
||||||
duration: timedelta | None = None,
|
duration: timedelta | None = None,
|
||||||
response: Message | None = None,
|
response: Message | None = None,
|
||||||
role: Role | None = None,
|
|
||||||
case: bool = True,
|
case: bool = True,
|
||||||
) -> Embed:
|
) -> Embed:
|
||||||
"""This function creates a message from set parameters, meant for contacting the moderated user.
|
"""This function creates a message from set parameters, meant for contacting the moderated user.
|
||||||
|
@ -37,7 +36,6 @@ async def message_factory(
|
||||||
moderator (Union[Member, User], optional): The moderator who performed the moderation. Defaults to None.
|
moderator (Union[Member, User], optional): The moderator who performed the moderation. Defaults to None.
|
||||||
duration (timedelta, optional): The duration of the moderation. Defaults to None.
|
duration (timedelta, optional): The duration of the moderation. Defaults to None.
|
||||||
response (Message, optional): The response message. Defaults to None.
|
response (Message, optional): The response message. Defaults to None.
|
||||||
role (Role, optional): The role that was added or removed. Defaults to None.
|
|
||||||
case (bool, optional): Whether the message is for a moderation case. Defaults to True.
|
case (bool, optional): Whether the message is for a moderation case. Defaults to True.
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue