Skip to content

The agent that grows with you

fix(discord): gate model picker cancel on callback auth

kshitijk4poora2ce2da09583
diff --git a/plugins/platforms/discord/adapter.py b/plugins/platforms/discord/adapter.py
index faed8108c71..905186ce2d5 100644
--- a/plugins/platforms/discord/adapter.py
+++ b/plugins/platforms/discord/adapter.py
@@ -6626,6 +6626,8 @@ def _define_discord_view_classes() -> None:
)
async def _on_cancel(self, interaction: discord.Interaction):
+ if not await self._gate(interaction, resolved_msg=None, unauth_msg=_UNAUTHORIZED):
+ return
self.resolved = True
self.clear_items()
await self._edit(interaction, "Model selection cancelled.", color=discord.Color.greyple())