Skip to content

Commit b024beb

Browse files
committed
lint using ruff
1 parent 13ab550 commit b024beb

File tree

2 files changed

+24
-28
lines changed

2 files changed

+24
-28
lines changed

main.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,9 @@ async def ping(ctx) -> None:
257257
value=f"{hours} hours {minutes} minutes {seconds} seconds",
258258
inline=False,
259259
)
260-
embed.set_user_footer_with_text(ctx, f"Information requested by: {ctx.author.name}")
260+
embed.set_user_footer_with_text(
261+
ctx, f"Information requested by: {ctx.author.name}"
262+
)
261263
embed.set_thumbnail(
262264
url="https://uploads.poxipage.com/7q5iw7dwl5jc3zdjaergjhpat27tws8bkr9fgy45_938843265627717703-webp"
263265
)
@@ -444,7 +446,9 @@ async def models(ctx) -> None:
444446
inline=False,
445447
)
446448

447-
embed.set_user_footer_with_text(ctx, f"Information requested by: {ctx.author.name} • Models last updated")
449+
embed.set_user_footer_with_text(
450+
ctx, f"Information requested by: {ctx.author.name} • Models last updated"
451+
)
448452

449453
await ctx.send(embed=embed)
450454

utils/embed_utils.py

Lines changed: 18 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -121,62 +121,52 @@ def set_footer(
121121
return self
122122

123123
def set_user_footer(
124-
self,
125-
interaction: discord.Interaction,
126-
prefix: str = "Generated by"
124+
self, interaction: discord.Interaction, prefix: str = "Generated by"
127125
) -> "SafeEmbed":
128126
"""
129127
Set footer with user information and proper avatar handling.
130-
128+
131129
Args:
132130
interaction: Discord interaction object
133131
prefix: Text prefix before the username (default: "Generated by")
134-
132+
135133
Example:
136134
embed.set_user_footer(interaction, "🐝 Cross-pollinated by")
137135
"""
138136
footer_text = f"{prefix} {interaction.user.display_name}"
139-
137+
140138
# Handle avatar URL with proper fallback
141139
icon_url = (
142-
interaction.user.avatar.url
143-
if interaction.user.avatar
140+
interaction.user.avatar.url
141+
if interaction.user.avatar
144142
else interaction.user.default_avatar.url
145143
)
146-
144+
147145
return self.set_footer(text=footer_text, icon_url=icon_url)
148146

149-
def set_user_footer_with_text(
150-
self,
151-
interaction_or_ctx,
152-
text: str
153-
) -> "SafeEmbed":
147+
def set_user_footer_with_text(self, interaction_or_ctx, text: str) -> "SafeEmbed":
154148
"""
155149
Set footer with custom text and user avatar.
156-
150+
157151
Args:
158152
interaction_or_ctx: Discord interaction object or command context
159153
text: Custom footer text
160-
154+
161155
Example:
162156
embed.set_user_footer_with_text(interaction, f"{interaction.user} used /{interaction.command.name}")
163157
embed.set_user_footer_with_text(ctx, f"Information requested by: {ctx.author.name}")
164158
"""
165159
# Handle both interaction and context objects
166-
if hasattr(interaction_or_ctx, 'user'):
160+
if hasattr(interaction_or_ctx, "user"):
167161
# It's an interaction
168162
user = interaction_or_ctx.user
169163
else:
170164
# It's a context
171165
user = interaction_or_ctx.author
172-
166+
173167
# Handle avatar URL with proper fallback
174-
icon_url = (
175-
user.avatar.url
176-
if user.avatar
177-
else user.default_avatar.url
178-
)
179-
168+
icon_url = user.avatar.url if user.avatar else user.default_avatar.url
169+
180170
return self.set_footer(text=text, icon_url=icon_url)
181171

182172
@_truncate_args(name=256)
@@ -277,7 +267,7 @@ async def generate_pollinate_embed(
277267
embed.set_image(url=dic["url"])
278268

279269
embed.set_user_footer(interaction, "Generated by")
280-
270+
281271
return embed
282272

283273

@@ -308,7 +298,9 @@ async def generate_error_message(
308298
inline=False,
309299
)
310300

311-
embed.set_user_footer_with_text(interaction, f"{interaction.user} used /{interaction.command.name}")
301+
embed.set_user_footer_with_text(
302+
interaction, f"{interaction.user} used /{interaction.command.name}"
303+
)
312304

313305
return embed
314306

0 commit comments

Comments
 (0)