Skip to content

Commit

Permalink
fix: rejected queue items not being removed from queues
Browse files Browse the repository at this point in the history
Closes #90
Resolves BT-50
  • Loading branch information
Skelmis committed Jun 24, 2024
1 parent 8066975 commit 8a74520
Showing 1 changed file with 17 additions and 19 deletions.
36 changes: 17 additions & 19 deletions suggestions/core/suggestions_queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,28 +148,26 @@ async def resolve_queued_suggestion(
)
icon_url = await self.bot.try_fetch_icon_url(guild_id)
guild = self.state.guild_cache.get_entry(guild_id)
if (
if not (
user_config.dm_messages_disabled
or guild_config.dm_messages_disabled
):
# Set up not to message users
return

embed: disnake.Embed = disnake.Embed(
description=self.bot.get_localized_string(
"QUEUE_INNER_USER_REJECTED", ih
),
colour=self.bot.colors.embed_color,
timestamp=self.state.now,
)
embed.set_author(
name=guild.name,
icon_url=icon_url,
)
embed.set_footer(text=f"Guild ID {guild_id}")
await user.send(
embeds=[embed, await queued_suggestion.as_embed(self.bot)]
)
# Set up to message users
embed: disnake.Embed = disnake.Embed(
description=self.bot.get_localized_string(
"QUEUE_INNER_USER_REJECTED", ih
),
colour=self.bot.colors.embed_color,
timestamp=self.state.now,
)
embed.set_author(
name=guild.name,
icon_url=icon_url,
)
embed.set_footer(text=f"Guild ID {guild_id}")
await user.send(
embeds=[embed, await queued_suggestion.as_embed(self.bot)]
)
except:
# Don't remove from queue on failure
if suggestion is not None:
Expand Down

0 comments on commit 8a74520

Please sign in to comment.