From 397099b27b74f7448d0c9c589f2d3c4acf100084 Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh <102361830+SeaswimmerTheFsh@users.noreply.github.com> Date: Tue, 20 Jun 2023 12:30:33 -0400 Subject: [PATCH] removed unused imports and fixed parse_timedelta --- moderation.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/moderation.py b/moderation.py index d06fd43..6cc719c 100644 --- a/moderation.py +++ b/moderation.py @@ -1,6 +1,3 @@ -import asyncio -import os -import aiohttp import revolt from revolt.ext import commands from datetime import timedelta @@ -9,7 +6,7 @@ class Moderation(commands.Cog): def __init__(self, bot): self.bot = bot - def parse_timedelta(input_str): + def parse_timedelta(self, input_str): # Split the string into its components (e.g., "1 day 3 hours" becomes ["1", "day", "3", "hours"]) components = input_str.split() @@ -35,7 +32,7 @@ class Moderation(commands.Cog): @commands.command(name="mute", aliases="timeout") async def mute(self, ctx, target: revolt.Member, duration: str = "1 hour"): - parsed_time = Moderation.parse_timedelta(duration) + parsed_time = Moderation.parse_timedelta(self, duration) await target.timeout(parsed_time) await ctx.message.reply(f"{target.mention} has been timed out for {str(parsed_time)}!")