Skip to content

Commit

Permalink
Merge pull request #200 from IgKniteDev/develop
Browse files Browse the repository at this point in the history
⚡ [tuning] Improved embeds for `/playrich`-based commands & more
  • Loading branch information
hitblast authored Mar 19, 2023
2 parents 4bc679f + a051cb8 commit c9b38d4
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
6 changes: 1 addition & 5 deletions cogs/moderation.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,11 +296,7 @@ async def _snipe(
) -> None:
webhooks: List[disnake.Webhook] = []
snipeables = sorted(
[
snipeable
for snipeable in keychain.snipeables
if snipeable.guild.id == inter.guild.id
],
[snipeable for snipeable in keychain.snipeables if snipeable.guild == inter.guild],
key=lambda x: x.created_at.timestamp(),
)
sniped_count: int = 0
Expand Down
13 changes: 11 additions & 2 deletions cogs/music.py
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ async def _leave(self, inter: disnake.CommandInteraction) -> None:

await inter.voice_state.stop()
del self.voice_states[inter.guild.id]
await inter.followup.send('Left voice state.')
await inter.send('Left voice state.')

# volume
@commands.slash_command(
Expand Down Expand Up @@ -906,7 +906,16 @@ async def _playrich_backend(
for activity in member.activities:
if isinstance(activity, disnake.Spotify):
track = Spotify.get_track_features(activity.track_id)
return await self._play_backend(inter, track)
await self._play_backend(inter, track, send_embed=False)

embed = disnake.Embed(
title='Fetched from Spotify!',
description=f'Now attempting to search for **"{track}"** on YouTube'
+ ' and enqueue it.',
color=1824608,
).set_image(url=activity.album_cover_url)

return await inter.send(embed=embed)

await inter.send('Nothing is being played on Spotify!', ephemeral=True)

Expand Down
4 changes: 2 additions & 2 deletions core/embeds.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ def __init__(

def set_title(self, value: str) -> Self:
'''
Sets the title for the embed content.
Sets the title for the embed.
'''
self.title = value
return self

def set_description(self, value: str) -> Self:
'''
Sets the description for the embed content.
Sets the description for the embed.
'''
self.description = value
return self
Expand Down

0 comments on commit c9b38d4

Please sign in to comment.