Skip to content

Commit

Permalink
Update staff.py
Browse files Browse the repository at this point in the history
  • Loading branch information
bugsbirb committed Nov 17, 2024
1 parent ec9ca93 commit 8c77ce1
Showing 1 changed file with 21 additions and 10 deletions.
31 changes: 21 additions & 10 deletions Cogs/Modules/staff.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
)
Expand Down Expand Up @@ -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:
Expand All @@ -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>"
)
Expand All @@ -482,15 +490,17 @@ 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
else:
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")
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 8c77ce1

Please sign in to comment.