Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
help: Move writing-bots from API docs to help center.
Lauryn Menardc8e2182dfcb2
diff --git a/api_docs/configuring-python-bindings.md b/api_docs/configuring-python-bindings.mdindex f804944fd69..42170dd18ab 100644--- a/api_docs/configuring-python-bindings.md+++ b/api_docs/configuring-python-bindings.md@@ -3,7 +3,7 @@Zulip provides a set of tools that allows interacting with its API moreeasily, called the [Python bindings](https://pypi.python.org/pypi/zulip/).One of the most notable use cases for these bindings are bots developed-using Zulip's [bot framework](/api/writing-bots).+using Zulip's [bot framework](/help/writing-bots).In order to use them, you need to configure them with your identity(account, API key, and Zulip server URL). There are a few ways todiff --git a/api_docs/non-webhook-integrations.md b/api_docs/non-webhook-integrations.mdindex 4c36368de04..23f22454515 100644--- a/api_docs/non-webhook-integrations.md+++ b/api_docs/non-webhook-integrations.md@@ -20,7 +20,7 @@ them. Zulip supports several other types of integrations.documentation for the third party software in order to learn how towrite the integration.-* **Interactive bots**. See [Writing bots](/api/writing-bots).+* **Interactive bots**. See [Writing bots](/help/writing-bots).A few notes on how to do these:@@ -55,7 +55,7 @@ examples of ideal UAs are:* [Running bots](/help/running-bots)* [Deploying bots](/help/deploying-bots)-* [Writing bots](/api/writing-bots)+* [Writing bots](/help/writing-bots)[incoming-webhooks-overview]: https://zulip.readthedocs.io/en/latest/webhooks/incoming-webhooks-overview.html[webhooks-general-advice]: https://zulip.readthedocs.io/en/latest/webhooks/incoming-webhooks-overview.html#general-advicediff --git a/api_docs/sidebar_index.md b/api_docs/sidebar_index.mdindex 4753c189f46..bf584a36919 100644--- a/api_docs/sidebar_index.md+++ b/api_docs/sidebar_index.md@@ -7,7 +7,7 @@## Interactive bots-* [Writing bots](/api/writing-bots)+* [Writing bots](/help/writing-bots)* [Interactive bots API](/help/interactive-bots-api)* [Writing tests for bots](/help/writing-tests-for-interactive-bots)* [Running bots](/help/running-bots)diff --git a/starlight_help/astro.config.mjs b/starlight_help/astro.config.mjsindex 104c18c06f1..3d017143317 100644--- a/starlight_help/astro.config.mjs+++ b/starlight_help/astro.config.mjs@@ -667,6 +667,7 @@ export default defineConfig({},"view-your-bots","view-all-bots-in-your-organization",+ "writing-bots","interactive-bots-api","writing-tests-for-interactive-bots","running-bots",diff --git a/starlight_help/src/content/docs/deploying-bots.mdx b/starlight_help/src/content/docs/deploying-bots.mdxindex e3a9929d71e..dbd3bb17b68 100644--- a/starlight_help/src/content/docs/deploying-bots.mdx+++ b/starlight_help/src/content/docs/deploying-bots.mdx@@ -250,4 +250,4 @@ Botserver with SSL using an `nginx` or `Apache` reverse proxy and* [Non-webhook integrations](/api/non-webhook-integrations)* [Running bots](/help/running-bots)-* [Writing bots](/api/writing-bots)+* [Writing bots](/help/writing-bots)diff --git a/starlight_help/src/content/docs/interactive-bots-api.mdx b/starlight_help/src/content/docs/interactive-bots-api.mdxindex 0cb8f175ec8..4fe4606fe44 100644--- a/starlight_help/src/content/docs/interactive-bots-api.mdx+++ b/starlight_help/src/content/docs/interactive-bots-api.mdx@@ -300,5 +300,5 @@ with use_storage(bot_handler.storage, ["foo", "bar"]) as cache:## Related articles-* [Writing bots](/api/writing-bots)+* [Writing bots](/help/writing-bots)* [Writing tests for bots](/help/writing-tests-for-interactive-bots)diff --git a/starlight_help/src/content/docs/moving-from-discord.mdx b/starlight_help/src/content/docs/moving-from-discord.mdxindex ca1c4190331..d1d651a974e 100644--- a/starlight_help/src/content/docs/moving-from-discord.mdx+++ b/starlight_help/src/content/docs/moving-from-discord.mdx@@ -65,7 +65,7 @@ think through the transition process in your own context.[topics](/help/introduction-to-topics) give each conversation its ownspace, so you likely need fewer channels than in Discord.1. To recreate your Discord bots in Zulip, check out Zulip's [native- integrations](/integrations), and the [guide](/api/writing-bots) on writing+ integrations](/integrations), and the [guide](/help/writing-bots) on writingyour own interactive bots.</Steps>diff --git a/starlight_help/src/content/docs/running-bots.mdx b/starlight_help/src/content/docs/running-bots.mdxindex f380522c78f..89d52fb17de 100644--- a/starlight_help/src/content/docs/running-bots.mdx+++ b/starlight_help/src/content/docs/running-bots.mdx@@ -6,7 +6,7 @@ import FlattenedSteps from "../../components/FlattenedSteps.astro";import ZulipNote from "../../components/ZulipNote.astro";Zulip's API has a powerful framework for interactive bots that react to messages-in Zulip. You can [write your own interactive bot](/api/writing-bots), or run an+in Zulip. You can [write your own interactive bot](/help/writing-bots), or run anexisting [Zulip bot](https://github.com/zulip/python-zulip-api/tree/main/zulip_bots/zulip_bots/bots).## Running a bot@@ -60,7 +60,7 @@ You'll need:<ZulipNote>To use the latest development version of the `zulip_bots` package, follow- [these steps](writing-bots#installing-a-development-version-of-the-zulip-bots-package).+ [these steps](/help/writing-bots#installing-a-development-version-of-the-zulip-bots-package).</ZulipNote>You can now play around with the bot and get it configured the way you@@ -72,4 +72,4 @@ server using the Zulip Botserver.* [Non-webhook integrations](/api/non-webhook-integrations)* [Deploying bots](/help/deploying-bots)-* [Writing bots](/api/writing-bots)+* [Writing bots](/help/writing-bots)diff --git a/api_docs/writing-bots.md b/starlight_help/src/content/docs/writing-bots.mdxsimilarity index 60%rename from api_docs/writing-bots.mdrename to starlight_help/src/content/docs/writing-bots.mdxindex 7ecac5e48b7..d4c9c2ad17a 100644--- a/api_docs/writing-bots.md+++ b/starlight_help/src/content/docs/writing-bots.mdx@@ -1,52 +1,57 @@-# Writing interactive bots+---+title: Writing interactive bots+---++import {Steps} from "@astrojs/starlight/components";++import FlattenedSteps from "../../components/FlattenedSteps.astro";+import ZulipNote from "../../components/ZulipNote.astro";Zulip's API has a powerful framework for interactive bots that react to messagesin Zulip. This page will guide you through writing your own interactive bot.-- [Installing a development version of the Zulip bots package](#installing-a-development-version-of-the-zulip-bots-package)-- [Bot template](#bot-template)-- [Testing a bot's output](#testing-a-bots-output)-- [Troubleshooting](#troubleshooting)+* [Installing a development version of the Zulip bots package](#installing-a-development-version-of-the-zulip-bots-package)+* [Bot template](#bot-template)+* [Testing a bot's output](#testing-a-bots-output)+* [Troubleshooting](#troubleshooting)## Installing a development version of the Zulip bots packageThis will provide convenient tooling for developing and testing your bot.-{start_tabs}--1. Clone the [python-zulip-api](https://github.com/zulip/python-zulip-api)- repository:-- ```- git clone https://github.com/zulip/python-zulip-api.git- ```+<FlattenedSteps>+ 1. Clone the [python-zulip-api](https://github.com/zulip/python-zulip-api)+ repository:-1. Navigate into your cloned repository:+ ```+ git clone https://github.com/zulip/python-zulip-api.git+ ```- ```- cd python-zulip-api- ```+ 1. Navigate into your cloned repository:-1. Install all requirements in a Python virtualenv:+ ```+ cd python-zulip-api+ ```- ```- python3 ./tools/provision- ```+ 1. Install all requirements in a Python virtualenv:-1. Run the command provided in the final output of the `provision` process to- enter the new virtualenv. The command will be of the form `source .../activate`.+ ```+ python3 ./tools/provision+ ```-1. You should now see the name of your virtualenv preceding your prompt (e.g.,- `(zulip-api-py3-venv)`).+ 1. Run the command provided in the final output of the `provision` process to+ enter the new virtualenv. The command will be of the form `source .../activate`.-!!! tip ""+ 1. You should now see the name of your virtualenv preceding your prompt (e.g.,+ `(zulip-api-py3-venv)`).+</FlattenedSteps>- `provision` installs the `zulip`, `zulip_bots`, and- `zulip_botserver` packages in developer mode. This enables you to- modify these packages and then run your modified code without- having to first re-install the packages or re-provision.--{end_tabs}+<ZulipNote>+ `provision` installs the `zulip`, `zulip_bots`, and+ `zulip_botserver` packages in developer mode. This enables you to+ modify these packages and then run your modified code without+ having to first re-install the packages or re-provision.+</ZulipNote>## Bot template@@ -85,13 +90,11 @@ placed in the same directory as `<my-bot>.py`.You can see how a bot reacts to a message without setting it up on a server,using the `zulip-bot-shell` tool.-{start_tabs}--1. [Install all requirements](#installing-a-development-version-of-the-zulip-bots-package).-1. Run `zulip-bot-shell` to test one of the bots in- [`zulip_bots/bots`](https://github.com/zulip/python-zulip-api/tree/main/zulip_bots/zulip_bots/bots).--{end_tabs}+<Steps>+ 1. [Install all requirements](#installing-a-development-version-of-the-zulip-bots-package).+ 1. Run `zulip-bot-shell` to test one of the bots in+ [`zulip_bots/bots`](https://github.com/zulip/python-zulip-api/tree/main/zulip_bots/zulip_bots/bots).+</Steps>Example invocations:@@ -110,15 +113,15 @@ Response: stream: followup topic: [email protected]```Note that the `-b` (aka `--bot-config-file`) argument is for an optional third party-config file (e.g., ~/giphy.conf), which only applies to certain types of bots.+config file (e.g., \~/giphy.conf), which only applies to certain types of bots.## Troubleshooting-### I modified my bot's code, yet the changes don't seem to have an effect.+### I modified my bot's code, yet the changes don't seem to have an effectEnsure that you restarted the `zulip-run-bot` script.-### My bot won't start.+### My bot won't start* Ensure that your API config file is correct (download the config file from the server).* Ensure that you bot script is located in `zulip_bots/bots/<my-bot>/`diff --git a/starlight_help/src/content/docs/writing-tests-for-interactive-bots.mdx b/starlight_help/src/content/docs/writing-tests-for-interactive-bots.mdxindex 836be4d1d63..99bfc149652 100644--- a/starlight_help/src/content/docs/writing-tests-for-interactive-bots.mdx+++ b/starlight_help/src/content/docs/writing-tests-for-interactive-bots.mdx@@ -124,5 +124,5 @@ to see examples of bot tests.## Related articles-* [Writing bots](/api/writing-bots)+* [Writing bots](/help/writing-bots)* [Interactive bots API](/help/interactive-bots-api)diff --git a/templates/corporate/zulip-cloud.html b/templates/corporate/zulip-cloud.htmlindex 0fd1b833b3f..e888a3d3bf5 100644--- a/templates/corporate/zulip-cloud.html+++ b/templates/corporate/zulip-cloud.html@@ -71,7 +71,7 @@<p>Connect Zulip to other tools with <a href="/integrations/">nativeintegrations</a> and powerful <a href="/api/">APIs</a>. An easy-to-use <a- href="https://zulip.com/api/writing-bots">bot+ href="/help/writing-bots">botframework</a>lets you <ahref="/case-studies/windborne/#the-perfect-platform-for-llm-bots">bringdiff --git a/templates/zerver/integrations/catalog.html b/templates/zerver/integrations/catalog.htmlindex e54a018e9ce..327e0238a0f 100644--- a/templates/zerver/integrations/catalog.html+++ b/templates/zerver/integrations/catalog.html@@ -66,7 +66,7 @@<a href="https://zulip.readthedocs.io/en/latest/webhooks/incoming-webhooks-overview.html"><h4>{% trans %}Incoming webhooks{% endtrans %}</h4></a>- <a href="/api/writing-bots">+ <a href="/help/writing-bots"><h4>{% trans %}Interactive bots{% endtrans %}</h4></a><a href="/api/rest">@@ -93,7 +93,7 @@<a href="https://zulip.readthedocs.io/en/latest/webhooks/incoming-webhooks-overview.html"><h4>{% trans %}Incoming webhooks{% endtrans %}</h4></a>- <a href="/api/writing-bots">+ <a href="/help/writing-bots"><h4>{% trans %}Interactive bots{% endtrans %}</h4></a><a href="/api/rest">diff --git a/zerver/lib/url_redirects.py b/zerver/lib/url_redirects.pyindex caef054c914..ac1a28b666c 100644--- a/zerver/lib/url_redirects.py+++ b/zerver/lib/url_redirects.py@@ -18,6 +18,7 @@ REDIRECTED_TO_HELP_DOCUMENTATION: list[URLRedirect] = ["/api/writing-tests-for-interactive-bots", "/help/writing-tests-for-interactive-bots"),URLRedirect("/api/interactive-bots-api", "/help/interactive-bots-api"),+ URLRedirect("/api/writing-bots", "/help/writing-bots"),]API_DOCUMENTATION_REDIRECTS: list[URLRedirect] = [