misc(moderation): improved code structure
All checks were successful
Pylint / Pylint (push) Successful in 50s
All checks were successful
Pylint / Pylint (push) Successful in 50s
This commit is contained in:
parent
944204a441
commit
60493fbd77
1 changed files with 3 additions and 3 deletions
|
@ -28,7 +28,7 @@ class Moderation(commands.Cog):
|
|||
connection = mysql.connector.connect(host=db_host,user=db_user,password=db_password,database=db)
|
||||
return connection
|
||||
|
||||
def create_server_table(self, server):
|
||||
def create_server_table(self, server: revolt.Server):
|
||||
database = Moderation.mysql_connect(self)
|
||||
cursor = database.cursor()
|
||||
try:
|
||||
|
@ -84,7 +84,7 @@ class Moderation(commands.Cog):
|
|||
cursor.close()
|
||||
print("Tempban Handler run successful!")
|
||||
|
||||
def mysql_log(self, ctx: commands.Context, moderation_type, target_id, duration, reason):
|
||||
def mysql_log(self, ctx: commands.Context, moderation_type: str, target_id: str, duration, reason:str ):
|
||||
timestamp = int(time.time())
|
||||
if duration != "NULL":
|
||||
end_timedelta = datetime.fromtimestamp(timestamp) + duration
|
||||
|
@ -229,7 +229,7 @@ class Moderation(commands.Cog):
|
|||
|
||||
|
||||
@commands.command(aliases=["tdc"])
|
||||
async def timedeltaconvert(self, ctx, *, duration):
|
||||
async def timedeltaconvert(self, ctx: commands.Context, *, duration: str):
|
||||
required_role = utils.get(ctx.server.roles, id=required_role_id)
|
||||
if required_role not in ctx.author.roles:
|
||||
await ctx.message.reply("You do not have permission to use this command!")
|
||||
|
|
Loading…
Reference in a new issue