Skip to content
This repository was archived by the owner on Mar 12, 2025. It is now read-only.

Commit c053caf

Browse files
committed
refactor(stars): use helper function
1 parent 3187ba6 commit c053caf

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

bot/exts/stars.py

+3-9
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,8 @@ async def stars_set(
6969
to_user_id=user.id,
7070
star_count=stars,
7171
)
72-
embed = Embed(
73-
description=f"Set star count for {user.mention}", color=disnake.Color.yellow()
74-
)
75-
user_stars = await store.get_user_stars(user.id)
76-
embed.add_field(name=f"{STAR_EMOJI} count", value=str(user_stars))
77-
embed.set_author(
78-
name=display_name(user),
79-
icon_url=user.avatar.url if user.avatar else Embed.Empty,
72+
embed = await make_user_star_count_embed(
73+
user=user, description=f"Set star count for {user.mention}"
8074
)
8175
await inter.response.send_message(embed=embed)
8276

@@ -171,7 +165,7 @@ async def _maybe_get_star_reaction_message_and_user(
171165
return None, None
172166
if not message.guild:
173167
return None, None
174-
if not message.guild.id == settings.SIGN_CAFE_GUILD_ID:
168+
if message.guild.id != settings.SIGN_CAFE_GUILD_ID:
175169
return None, None
176170
if bool(getattr(message.author, "bot", None)): # User is a bot
177171
return None, None

0 commit comments

Comments
 (0)