Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit 607783b
Author: DestinyofYeet <57575330+DestinyofYeet@users.noreply.github.com>
Date:   Wed Nov 22 14:43:34 2023 +0100

    "Now playing" now respects DeleteNowPlaying option
  • Loading branch information
BabyBoySnow committed Nov 22, 2023
1 parent e8eebff commit 7295687
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions musicbot/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,9 @@ async def on_player_play(self, player, entry):

# send it in specified channel
self.server_specific_data[guild]["last_np_msg"] = await self.safe_send_message(
channel, content if self.config.embeds else newmsg, expire_in=30
channel,
content if self.config.embeds else newmsg,
expire_in=30 if self.config.delete_nowplaying else 0,
)

# TODO: Check channel voice state?
Expand Down Expand Up @@ -1008,7 +1010,7 @@ async def safe_send_message(self, dest, content, **kwargs):
if self.config.delete_messages:
if msg and expire_in:
asyncio.ensure_future(self._wait_delete_msg(msg, expire_in))

if self.config.delete_invoking:
if also_delete and isinstance(also_delete, discord.Message):
asyncio.ensure_future(self._wait_delete_msg(also_delete, expire_in))
Expand Down Expand Up @@ -1308,6 +1310,9 @@ async def on_ready(self):
" Delete Invoking: "
+ ["Disabled", "Enabled"][self.config.delete_invoking]
)
log.info(
f" Delete Nowplaying: {['Disabled', 'Enabled'][self.config.delete_nowplaying]}"
)
log.info(" Debug Mode: " + ["Disabled", "Enabled"][self.config.debug_mode])
log.info(
" Downloaded songs will be "
Expand Down

0 comments on commit 7295687

Please sign in to comment.