Skip to content

Commit

Permalink
Fix issues with ConfessionModal second chance
Browse files Browse the repository at this point in the history
  • Loading branch information
yiays committed Sep 9, 2024
1 parent 0c5704a commit aa87fed
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions extensions/confessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,19 +184,20 @@ def __init__(

async def callback(self, inter:disnake.ModalInteraction):
""" Send the completed confession """
self.confession.set_content(inter.text_values['content'])

#TODO: This is copy-pasted from /confess. Maybe this check should be in common?
matches,_ = self.parent.listavailablechannels(inter.author)
if self.confession.channeltype == ChannelType.unset():
# User used /confess in the wrong channel, give them a chance to choose another
await inter.send(
self.parent.babel(inter, 'channelprompt') +
(' '+self.parent.babel(inter, 'channelprompt_pager', page=1) if len(matches) > 25 else ''),
view=ChannelSelectView(inter, self, matches, confession=self.confession),
view=ChannelSelectView(inter, self.parent, matches, confession=self.confession),
ephemeral=True
)
return

self.confession.set_content(inter.text_values['content'])
if vetting := await self.confession.check_vetting(inter):
await inter.bot.cogs['ConfessionsModeration'].send_vetting(inter, self.confession, vetting)
return
Expand Down

0 comments on commit aa87fed

Please sign in to comment.