Skip to content

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

fix(backend/copilot-bot): point /unlink button to the new bots page (#13198)

Bently9c194bfa8406
diff --git a/autogpt_platform/backend/backend/copilot/bot/adapters/discord/commands.py b/autogpt_platform/backend/backend/copilot/bot/adapters/discord/commands.py
index 93b7a1a4fb..3c7c879ac8 100644
--- a/autogpt_platform/backend/backend/copilot/bot/adapters/discord/commands.py
+++ b/autogpt_platform/backend/backend/copilot/bot/adapters/discord/commands.py
@@ -144,8 +144,7 @@ async def _handle_unlink(interaction: discord.Interaction) -> None:
if not base_url:
await interaction.response.send_message(
- f"{message}\n\nOpen your AutoGPT settings and visit "
- "Profile → Linked accounts.",
+ f"{message}\n\nOpen AutoGPT on the web and go to " "Settings → Bots.",
ephemeral=True,
)
return
@@ -155,7 +154,7 @@ async def _handle_unlink(interaction: discord.Interaction) -> None:
discord.ui.Button(
style=discord.ButtonStyle.link,
label="Open Settings",
- url=f"{base_url}/profile/settings",
+ url=f"{base_url}/settings/bots",
)
)
await interaction.response.send_message(message, ephemeral=True, view=view)
diff --git a/autogpt_platform/backend/backend/copilot/bot/adapters/discord/commands_test.py b/autogpt_platform/backend/backend/copilot/bot/adapters/discord/commands_test.py
index a549fea0cf..dc79e837d9 100644
--- a/autogpt_platform/backend/backend/copilot/bot/adapters/discord/commands_test.py
+++ b/autogpt_platform/backend/backend/copilot/bot/adapters/discord/commands_test.py
@@ -151,6 +151,11 @@ class TestHandleUnlink:
sent = interaction.response.send_message.await_args
assert sent.kwargs["view"] is not None
assert sent.kwargs["ephemeral"] is True
+ view = sent.kwargs["view"]
+ assert any(
+ getattr(child, "url", "").endswith("/settings/bots")
+ for child in view.children
+ )
@pytest.mark.asyncio
async def test_falls_back_to_platform_base_url(self):
@@ -185,7 +190,7 @@ class TestHandleUnlink:
sent = interaction.response.send_message.await_args
assert "view" not in sent.kwargs or sent.kwargs.get("view") is None
- assert "Profile" in sent.args[0]
+ assert "Bots" in sent.args[0]
class TestHandleNew: