From af108519f99792061ad93ac6f6c7c1d1a815206d Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Fri, 3 May 2024 21:35:29 -0400 Subject: [PATCH] feat(aurora): imma be real chief i have no idea what i did this commit --- aurora/aurora.py | 39 +++++++++++++++++++++++------------- aurora/data/arrow.png | Bin 0 -> 6319 bytes aurora/utilities/factory.py | 12 +++++++---- aurora/utilities/utils.py | 9 +++++++-- 4 files changed, 40 insertions(+), 20 deletions(-) create mode 100644 aurora/data/arrow.png diff --git a/aurora/aurora.py b/aurora/aurora.py index 065bafe..89664c0 100644 --- a/aurora/aurora.py +++ b/aurora/aurora.py @@ -19,7 +19,8 @@ from redbot.core import app_commands, commands, data_manager from redbot.core.app_commands import Choice from redbot.core.bot import Red from redbot.core.commands.converter import parse_relativedelta, parse_timedelta -from redbot.core.utils.chat_formatting import box, error, humanize_list, humanize_timedelta, warning +from redbot.core.utils.chat_formatting import (box, error, humanize_list, + humanize_timedelta, warning) from aurora.importers.aurora import ImportAuroraView from aurora.importers.galacticbot import ImportGalacticBotView @@ -28,10 +29,19 @@ from aurora.menus.guild import Guild from aurora.menus.immune import Immune from aurora.menus.overrides import Overrides from aurora.utilities.config import config, register_config -from aurora.utilities.database import connect, create_guild_table, fetch_case, mysql_log -from aurora.utilities.factory import addrole_embed, case_factory, changes_factory, evidenceformat_factory, guild_embed, immune_embed, message_factory, overrides_embed +from aurora.utilities.database import (connect, create_guild_table, fetch_case, + mysql_log) +from aurora.utilities.factory import (addrole_embed, case_factory, + changes_factory, evidenceformat_factory, + guild_embed, immune_embed, + message_factory, overrides_embed) from aurora.utilities.logger import logger -from aurora.utilities.utils import check_moddable, check_permissions, convert_timedelta_to_str, fetch_channel_dict, fetch_user_dict, generate_dict, log, send_evidenceformat, timedelta_from_relativedelta +from aurora.utilities.utils import (check_moddable, check_permissions, + convert_timedelta_to_str, + fetch_channel_dict, fetch_user_dict, + generate_dict, get_footer_image, log, + send_evidenceformat, + timedelta_from_relativedelta) class Aurora(commands.Cog): @@ -224,7 +234,7 @@ class Aurora(commands.Cog): moderation_type="note", response=await interaction.original_response(), ) - await target.send(embed=embed) + await target.send(embed=embed, file=get_footer_image(self)) except discord.errors.HTTPException: pass @@ -283,7 +293,7 @@ class Aurora(commands.Cog): moderation_type="warned", response=await interaction.original_response(), ) - await target.send(embed=embed) + await target.send(embed=embed, file=get_footer_image(self)) except discord.errors.HTTPException: pass @@ -381,7 +391,7 @@ class Aurora(commands.Cog): duration=parsed_time, role=role, ) - await target.send(embed=embed) + await target.send(embed=embed, file=get_footer_image(self)) except discord.errors.HTTPException: pass @@ -487,7 +497,7 @@ class Aurora(commands.Cog): duration=parsed_time, role=role, ) - await target.send(embed=embed) + await target.send(embed=embed, file=get_footer_image(self)) except discord.errors.HTTPException: pass @@ -583,7 +593,7 @@ class Aurora(commands.Cog): response=await interaction.original_response(), duration=parsed_time, ) - await target.send(embed=embed) + await target.send(embed=embed, file=get_footer_image(self)) except discord.errors.HTTPException: pass @@ -658,7 +668,7 @@ class Aurora(commands.Cog): moderation_type="unmuted", response=await interaction.original_response(), ) - await target.send(embed=embed) + await target.send(embed=embed, file=get_footer_image(self)) except discord.errors.HTTPException: pass @@ -717,7 +727,7 @@ class Aurora(commands.Cog): moderation_type="kicked", response=await interaction.original_response(), ) - await target.send(embed=embed) + await target.send(embed=embed, file=get_footer_image(self)) except discord.errors.HTTPException: pass @@ -821,7 +831,7 @@ class Aurora(commands.Cog): response=await interaction.original_response(), duration=parsed_time, ) - await target.send(embed=embed) + await target.send(embed=embed, file=get_footer_image(self)) except discord.errors.HTTPException: pass @@ -865,7 +875,7 @@ class Aurora(commands.Cog): moderation_type="banned", response=await interaction.original_response(), ) - await target.send(embed=embed) + await target.send(embed=embed, file=get_footer_image(self)) except discord.errors.HTTPException: pass @@ -948,7 +958,7 @@ class Aurora(commands.Cog): moderation_type="unbanned", response=await interaction.original_response(), ) - await target.send(embed=embed) + await target.send(embed=embed, file=get_footer_image(self)) except discord.errors.HTTPException: pass @@ -1646,6 +1656,7 @@ class Aurora(commands.Cog): embed = await message_factory( await self.bot.get_embed_color(guild.channels[0]), + file=get_footer_image(self), guild=guild, reason=f"Automatic unban from case #{moderation_id}", moderation_type="unbanned", diff --git a/aurora/data/arrow.png b/aurora/data/arrow.png new file mode 100644 index 0000000000000000000000000000000000000000..aedf12e53c700e75179027e0f7eca965547166d9 GIT binary patch literal 6319 zcmb_=X*kqh`1f~KjKNs4WG7o$CS_MMNcJszwy|W(R(8pJZ7ot1qHL2SehDqs$jFjJ z6j9kmlqE4jCdPc9`TyTNFP?YL{o>r8bDw*=&bhC1?(1B)w>9Iz9K-+sz++*4>I?wD z*$@tJBG|0E>QFzMA%l!;i~!(S4mZ;m#h%Ofo1d`(fFwl#05bq!mn{O903a3*04pQ_ z&@Tc2k*Jb32SfG(M~sDyDaQ{u1}=`&gv=AzB3FBBCsQ_;`Ts<+va)PX?2%12zK_z_ zt|em5*g66@89ae#XYWIbj3R?Mx#g7lhED46$SiH0Zv3Qmi>(LqvobpcTti8kvr|^H zIA!FN@a?zPa#E!(b|KiZesNX^)1DmNdjh1s`w1Fmql}PRex&w)3AIW|y!9=+ZRH){0wN2nZds8UphT zWD&`!N2{1y*XcTXvRmn8G4s8mp|G;?yz*Lc)>1k6$YPBg7W#c7%@XIeW~R^pLQN{! z;z?;OmJo*@1!(i>o{h{x2r=X=Khwz%0qh&MAP7=}DdUbYm60F2`7p_23{w=OgQ2J} zd$(VO^Y`(LkHj-H-V2{o6%p;JfADTI$PwT%`WWf(RXo+8?H=F8ieCLJ~j$}Qrd*y3Pp!6_2 zd@g8Yp9%9G8@hFBNnRj*?^nrR^;eV_tLM|^O8@cPO~ z<1RP)vX8{bBa~O`9+6NCuQQY^ z9ArDRrYs_aYx1BA*ZkS}!ar5WP{+Ztl@JN`l^qJ3~WPBr|rwD=Oj5xVQ~yThh&L+d`V)YOeo1# zj_XN^%);>LTKc-2zJfxdKzf(})`kBFW@qsd=*lYB zlh!TAe`slrYSK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95W zeexXv|MPoI9`&L3T9%%2R2FRaHEwf9>S%?Ixa^^xLFM9~(U|0`&t8P_aR?M&YM&Qt%^y)h~0F}?04 zcDHDRpUlV9O4=&}Wo7;<4L-B_j;#2ePwzh3husi5N~_-D)_^`_g87zo!?sJa+7A3b zRwB&ro*xO3=~Q2viFMwDUDgig^~XB%RH`d=POU-R!JfAUpBzlU*#Dg^c|AYA^6kLf zb8LGwg_C=~_xIkif%#Cl7-L-2JNoHT2T25TDLfvbA3CXVF`%_5NLOV5x1P)$ICTiizjjsWd9$wQBvKY5JI;V83Ily&H@^5V4@gu0=`8~QFP_VX(**UwN)H*yTKmMWbj% zziiV3-m%2fvcg9D7hK^Btm-3OPO>|bJII?Ol8Ez&>2>7+7jKm%`+uc>Go6*V_WxxM ztb6m9W%j3v)e!vjfUS;b5`6dLM4HSt6}c7vn>+0=`n;>r_HS?Oib{S>&bgU~Sw^3w ztkYV1#|YnKm5bBka;*VEk@8B!wBGN+sDCD-$i>SmU1Mbqo89M(ocUN6yGER--f61J zE8|bq-L5vNkNmU}M4L`y^VI%$-E`MzcUAqbZS6|xyu?s_%Y-THc72_8dthedM_#h& z=5FV3JtR|S4N2E1zfP_{SO_r2oqxJTf38F!BFw(Cl_ td: now = datetime.now() then = now - relativedelta return now - then + +def get_footer_image(coginstance: commands.Cog) -> File: + """Returns the footer image for the embeds.""" + image_path = data_manager.bundled_data_path(coginstance) / "arrow.png" + return File(image_path, filename="arrow.png", description="arrow")