Open-source Python library for AI browser agents, plus Browser Use Cloud: stealth browsers and a hosted agent API.
Python ai-agentsai-toolsbrowser-agentbrowser-automationbrowser-usecdpcloud-browsercomputer-useheadless-browserllmmcpplaywrightpythonremote-browserstealth-browserweb-automationweb-scraping
move discord_api.py in ./integrations directory
Malik Talha425753c15b86
diff --git a/examples/discord_api.py b/examples/integrations/discord_api.pysimilarity index 97%rename from examples/discord_api.pyrename to examples/integrations/discord_api.pyindex 835acbb7f..9b449c2c7 100644--- a/examples/discord_api.py+++ b/examples/integrations/discord_api.py@@ -1,5 +1,4 @@from langchain_core.language_models.chat_models import BaseChatModel-from dotenv import load_dotenvimport discordfrom discord.ext import commands@@ -7,14 +6,15 @@ from discord.ext import commandsfrom browser_use.agent.service import Agent, Browserfrom browser_use import BrowserConfig-+from dotenv import load_dotenvload_dotenv()class DiscordBot(commands.Bot):"""Discord bot implementation for Browser-Use tasks.- This bot allows users to run browser automation tasks through Discord messages.+ This bot allows users to run browser automation tasks through Discord messages.+ Processes tasks asynchronously and sends the result back to the user in response to the message.Messages must start with the configured prefix (default: "$bu") followed by the task description.Args:@@ -66,7 +66,7 @@ class DiscordBot(commands.Bot):try:print(f'We have logged in as {self.user}')cmds = await self.tree.sync() # Sync the command tree with discord- print(f"Synced commands: {cmds}")+except Exception as e:print(f"Error during bot startup: {e}")