From 8c77ce1e2e5e4a7b5953750e96ae1ba165255b12 Mon Sep 17 00:00:00 2001 From: Bugsy <124417333+bugsbirb@users.noreply.github.com> Date: Sun, 17 Nov 2024 16:10:36 +0000 Subject: [PATCH] Update staff.py --- Cogs/Modules/staff.py | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/Cogs/Modules/staff.py b/Cogs/Modules/staff.py index ffa6dca9..b46af391 100644 --- a/Cogs/Modules/staff.py +++ b/Cogs/Modules/staff.py @@ -288,12 +288,14 @@ async def quota_activity(self): try: if data.get("enabled", False) is False: continue - if not await ModuleCheck(data.get('guild_id', 0), 'Quota'): + if not await ModuleCheck(data.get("guild_id", 0), "Quota"): continue try: channel = self.client.get_channel(data.get("channel_id", None)) except (discord.HTTPException, discord.NotFound): - print(f"[ERROR] Channel {data.get('channel_id', None)} not found.") + print( + f"[ERROR] Channel {data.get('channel_id', None)} not found." + ) pass days = [ "sunday", @@ -323,6 +325,9 @@ async def quota_activity(self): if next_occurrence_date < datetime.now(): next_occurrence_date += timedelta(days=7) + if not datetime.now() >= nextdate: + continue + if datetime.now() >= nextdate: try: @@ -385,14 +390,13 @@ async def quota_activity(self): if not result: continue - if Config.get("LOA", {}).get("role"): OnLOA = any( - role.id == Config.get("LOA", {}).get("role") + role.id + == Config.get("LOA", {}).get("role") for role in user.roles ) - Quota = Config.get("Message Quota", {}).get( "quota", 0 ) @@ -450,7 +454,9 @@ async def quota_activity(self): loaembed = discord.Embed( title="On LOA", color=discord.Color.purple() ) - loaembed.set_image(url="https://www.astrobirb.dev/invisble.png") + loaembed.set_image( + url="https://www.astrobirb.dev/invisble.png" + ) if on_loa: loaembed.description = "\n".join(on_loa) else: @@ -472,7 +478,9 @@ async def quota_activity(self): if not prem: view.punishfailures.disabled = True view.punishfailures.label = "[💎] Punish Failures" - view.punishfailures.style = discord.ButtonStyle.blurple + view.punishfailures.style = ( + discord.ButtonStyle.blurple + ) view.punishfailures.emoji = ( "<:Premium:1280561839385743512>" ) @@ -482,7 +490,9 @@ async def quota_activity(self): embeds=[passedembed, loaembed, failedembed], view=view, ) - print(f'[Activity Auto] succesfully sent @{guild.name}') + print( + f"[Activity Auto] succesfully sent @{guild.name}" + ) except discord.Forbidden: print("[ERROR] Channel not found") return @@ -490,7 +500,7 @@ async def quota_activity(self): print("[NOTFOUND] Channel not found") continue except Exception as e: - print(f'[QUOTA ERROR] {e}') + print(f"[QUOTA ERROR] {e}") continue @commands.hybrid_group(name="staff") @@ -884,7 +894,7 @@ async def leaderboard(self, ctx: commands.Context): embed.set_thumbnail(url=ctx.guild.icon) embed.set_author(name=ctx.guild.name, icon_url=ctx.guild.icon) pages.append(embed) - Description = "" + Description = "" i += 1 @@ -1145,6 +1155,7 @@ async def panel(self, ctx: commands.Context): if custom: if custom.get("embed") is True: from Cogs.Configuration.Components.EmbedBuilder import DisplayEmbed + embed = await DisplayEmbed(custom, ctx.author) view = Staffview() content = custom.get("content", None)