Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

help: Move running-bots article from API docs to help center.

Lauryn Menardb86ba956be26
diff --git a/api_docs/configuring-python-bindings.md b/api_docs/configuring-python-bindings.md
index a3a9289d5b4..f804944fd69 100644
--- a/api_docs/configuring-python-bindings.md
+++ b/api_docs/configuring-python-bindings.md
@@ -164,5 +164,5 @@ can be found in the following table:
* [Installation instructions](/api/installation-instructions)
* [API keys](/api/api-keys)
-* [Running bots](/api/running-bots)
+* [Running bots](/help/running-bots)
* [Deploying bots](/help/deploying-bots)
diff --git a/api_docs/index.md b/api_docs/index.md
index 40eab3fffbc..09cae5db56d 100644
--- a/api_docs/index.md
+++ b/api_docs/index.md
@@ -15,7 +15,7 @@ guide should help you find the API you need:
or use [Zulip's API for sending messages](/api/send-message).
* If you're building an interactive bot that reacts to activity inside
Zulip, you'll want to look at Zulip's
- [Python framework for interactive bots](/api/running-bots) or
+ [Python framework for interactive bots](/help/running-bots) or
[Zulip's real-time events API](/api/get-events).
And if you still need to build your own integration with Zulip, check out
diff --git a/api_docs/integrations-overview.md b/api_docs/integrations-overview.md
index 4f2e087e39c..4be370ca7e6 100644
--- a/api_docs/integrations-overview.md
+++ b/api_docs/integrations-overview.md
@@ -115,7 +115,7 @@ Sales](mailto:[email protected]).
### Sending and receiving content
* To react to activity inside Zulip, look at Zulip's
- [Python framework for interactive bots](/api/running-bots) or
+ [Python framework for interactive bots](/help/running-bots) or
[Zulip's real-time events API](/api/get-events).
* If what you want isn't covered by the above, check out the full
[REST API](/api/rest). The web, mobile, desktop, and terminal apps are
diff --git a/api_docs/non-webhook-integrations.md b/api_docs/non-webhook-integrations.md
index c87fc2e3628..4c36368de04 100644
--- a/api_docs/non-webhook-integrations.md
+++ b/api_docs/non-webhook-integrations.md
@@ -53,7 +53,7 @@ examples of ideal UAs are:
## Related articles
-* [Running bots](/api/running-bots)
+* [Running bots](/help/running-bots)
* [Deploying bots](/help/deploying-bots)
* [Writing bots](/api/writing-bots)
diff --git a/api_docs/running-bots.md b/api_docs/running-bots.md
deleted file mode 100644
index 3c6095b4f86..00000000000
--- a/api_docs/running-bots.md
+++ /dev/null
@@ -1,66 +0,0 @@
-# Running interactive bots
-
-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 a
-Zulip bot from [zulip_bots/bots](
-https://github.com/zulip/python-zulip-api/tree/main/zulip_bots/zulip_bots/bots).
-
-## Running a bot
-
-This guide will show you how to run an existing Zulip bot
-found in [zulip_bots/bots](
-https://github.com/zulip/python-zulip-api/tree/main/zulip_bots/zulip_bots/bots).
-
-You'll need:
-
-* An account in a Zulip organization
- (e.g., [the Zulip development community](https://zulip.com/development-community/),
- `{{ display_host }}`, or a Zulip organization on your own
- [development](https://zulip.readthedocs.io/en/latest/development/overview.html) or
- [production](https://zulip.readthedocs.io/en/latest/production/install.html) server).
-* A computer where you're running the bot from.
-
-**Note: Please be considerate when testing experimental bots on public servers such as chat.zulip.org.**
-
-{start_tabs}
-
-1. [Create a bot](/help/add-a-bot-or-integration), making sure to select
- **Generic bot** as the **Bot type**.
-
-1. [Download the bot's `zuliprc` file](/api/configuring-python-bindings#download-a-zuliprc-file).
-
-1. Use the following command to install the
- [`zulip_bots` Python package](https://pypi.org/project/zulip-bots/):
-
- pip3 install zulip_bots
-
-1. Use the following command to start the bot process *(replacing
- `~/path/to/zuliprc` with the path to the `zuliprc` file you downloaded above)*:
-
- zulip-run-bot <bot-name> --config-file ~/path/to/zuliprc
-
-1. Check the output of the command above to make sure your bot is running.
- It should include the following line:
-
- INFO:root:starting message handling...
-
-1. Test your setup by [starting a new direct message](/help/starting-a-new-direct-message)
- with the bot or [mentioning](/help/mention-a-user-or-group) the bot on a channel.
-
-!!! tip ""
-
- 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).
-
-{end_tabs}
-
-You can now play around with the bot and get it configured the way you
-like. Eventually, you'll probably want to run it in a production
-environment where it'll stay up, by [deploying](/help/deploying-bots) it on a
-server using the Zulip Botserver.
-
-## Related articles
-
-* [Non-webhook integrations](/api/non-webhook-integrations)
-* [Deploying bots](/help/deploying-bots)
-* [Writing bots](/api/writing-bots)
diff --git a/api_docs/sidebar_index.md b/api_docs/sidebar_index.md
index 8dd3e406a8e..6abf97aba17 100644
--- a/api_docs/sidebar_index.md
+++ b/api_docs/sidebar_index.md
@@ -10,7 +10,7 @@
* [Writing bots](/api/writing-bots)
* [Interactive bots API](/api/interactive-bots-api)
* [Writing tests for bots](/api/writing-tests-for-interactive-bots)
-* [Running bots](/api/running-bots)
+* [Running bots](/help/running-bots)
* [Deploying bots](/help/deploying-bots)
* [Outgoing webhooks](/help/outgoing-webhooks)
diff --git a/api_docs/writing-bots.md b/api_docs/writing-bots.md
index 168e35cd039..5cd3bd1688d 100644
--- a/api_docs/writing-bots.md
+++ b/api_docs/writing-bots.md
@@ -129,7 +129,7 @@ Ensure that you restarted the `zulip-run-bot` script.
* [Interactive bots API](/api/interactive-bots-api)
* [Writing tests for bots](/api/writing-tests-for-interactive-bots)
-* [Running bots](/api/running-bots)
+* [Running bots](/help/running-bots)
* [Deploying bots](/help/deploying-bots)
* [Configuring the Python bindings](/api/configuring-python-bindings)
* [Non-webhook integrations](/api/non-webhook-integrations)
diff --git a/starlight_help/astro.config.mjs b/starlight_help/astro.config.mjs
index c8e99e5bc3a..a448a156a12 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",
+ "running-bots",
"deploying-bots",
"outgoing-webhooks",
],
diff --git a/starlight_help/src/content/docs/deploying-bots.mdx b/starlight_help/src/content/docs/deploying-bots.mdx
index f40fa102611..e3a9929d71e 100644
--- a/starlight_help/src/content/docs/deploying-bots.mdx
+++ b/starlight_help/src/content/docs/deploying-bots.mdx
@@ -232,7 +232,7 @@ Botserver with SSL using an `nginx` or `Apache` reverse proxy and
* Your Botserver needs to be accessible from your Zulip server over
HTTP(S). Make sure any firewall allows the connection. We
- recommend using [zulip-run-bot](running-bots) instead for
+ recommend using [zulip-run-bot](/help/running-bots) instead for
development/testing on a laptop or other non-server system.
If your Zulip server is self-hosted, you can test by running `curl
http://zulipbotserver.example.com:5002` from your Zulip server;
@@ -249,5 +249,5 @@ Botserver with SSL using an `nginx` or `Apache` reverse proxy and
## Related articles
* [Non-webhook integrations](/api/non-webhook-integrations)
-* [Running bots](/api/running-bots)
+* [Running bots](/help/running-bots)
* [Writing bots](/api/writing-bots)
diff --git a/starlight_help/src/content/docs/integrations-overview.mdx b/starlight_help/src/content/docs/integrations-overview.mdx
index d6cb1c9ce83..8b5e9116cec 100644
--- a/starlight_help/src/content/docs/integrations-overview.mdx
+++ b/starlight_help/src/content/docs/integrations-overview.mdx
@@ -112,7 +112,7 @@ Sales](mailto:[email protected]).
### Sending and receiving content
* To react to activity inside Zulip, look at Zulip's
- [Python framework for interactive bots](/api/running-bots) or
+ [Python framework for interactive bots](/help/running-bots) or
[Zulip's real-time events API](/api/get-events).
* If what you want isn't covered by the above, check out the full
[REST API](/api/rest). The web, mobile, desktop, and terminal apps are
diff --git a/starlight_help/src/content/docs/running-bots.mdx b/starlight_help/src/content/docs/running-bots.mdx
new file mode 100644
index 00000000000..f380522c78f
--- /dev/null
+++ b/starlight_help/src/content/docs/running-bots.mdx
@@ -0,0 +1,75 @@
+---
+title: Running interactive bots
+---
+
+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
+existing [Zulip bot](https://github.com/zulip/python-zulip-api/tree/main/zulip_bots/zulip_bots/bots).
+
+## Running a bot
+
+This guide will show you how to run an existing
+[Zulip bot](https://github.com/zulip/python-zulip-api/tree/main/zulip_bots/zulip_bots/bots).
+
+<ZulipNote>
+ Please be considerate when testing experimental bots on public servers such as chat.zulip.org.
+</ZulipNote>
+
+You'll need:
+
+* An account in a Zulip organization
+ (e.g., [the Zulip development community](https://zulip.com/development-community/),
+ `{{ display_host }}`, or a Zulip organization on your own
+ [development](https://zulip.readthedocs.io/en/latest/development/overview.html) or
+ [production](https://zulip.readthedocs.io/en/latest/production/install.html) server).
+* A computer where you're running the bot from.
+
+<FlattenedSteps>
+ 1. [Create a bot](/help/add-a-bot-or-integration), making sure to select
+ **Generic bot** as the **Bot type**.
+
+ 1. [Download the bot's `zuliprc` file](/api/configuring-python-bindings#download-a-zuliprc-file).
+
+ 1. Use the following command to install the
+ [`zulip_bots` Python package](https://pypi.org/project/zulip-bots/):
+
+ ```
+ pip3 install zulip_bots
+ ```
+
+ 1. Use the following command to start the bot process *(replacing
+ `~/path/to/zuliprc` with the path to the `zuliprc` file you downloaded above)*:
+
+ ```
+ zulip-run-bot <bot-name> --config-file ~/path/to/zuliprc
+ ```
+
+ 1. Check the output of the command above to make sure your bot is running.
+ It should include the following line:
+
+ ```
+ INFO:root:starting message handling...
+ ```
+
+ 1. Test your setup by [starting a new direct message](/help/starting-a-new-direct-message)
+ with the bot or [mentioning](/help/mention-a-user-or-group) the bot on a channel.
+</FlattenedSteps>
+
+<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).
+</ZulipNote>
+
+You can now play around with the bot and get it configured the way you
+like. Eventually, you'll probably want to run it in a production
+environment where it'll stay up, by [deploying](/help/deploying-bots) it on a
+server using the Zulip Botserver.
+
+## Related articles
+
+* [Non-webhook integrations](/api/non-webhook-integrations)
+* [Deploying bots](/help/deploying-bots)
+* [Writing bots](/api/writing-bots)
diff --git a/templates/corporate/for/business.html b/templates/corporate/for/business.html
index d546ce7d3ae..144582528bb 100644
--- a/templates/corporate/for/business.html
+++ b/templates/corporate/for/business.html
@@ -284,7 +284,7 @@
bindings</a>, <a href="https://zulip.readthedocs.io/en/latest/webhooks/incoming-webhooks-overview.html">incoming
webhooks</a>, <a href="/help/outgoing-webhooks">outgoing
webhooks</a>
- and <a href="/api/running-bots">interactive
+ and <a href="/help/running-bots">interactive
bot framework</a>.
</div>
</li>
diff --git a/templates/corporate/for/open-source.html b/templates/corporate/for/open-source.html
index f1babf85c89..9b27cf16c1f 100644
--- a/templates/corporate/for/open-source.html
+++ b/templates/corporate/for/open-source.html
@@ -526,7 +526,7 @@
bindings</a>, <a href="https://zulip.readthedocs.io/en/latest/webhooks/incoming-webhooks-overview.html">incoming
webhooks</a>, <a href="/help/outgoing-webhooks">outgoing
webhooks</a>
- and <a href="/api/running-bots">interactive
+ and <a href="/help/running-bots">interactive
bot framework</a>.
</div>
</li>
diff --git a/zerver/lib/url_redirects.py b/zerver/lib/url_redirects.py
index ce94a809eaf..b524ede155a 100644
--- a/zerver/lib/url_redirects.py
+++ b/zerver/lib/url_redirects.py
@@ -13,6 +13,7 @@ class URLRedirect:
REDIRECTED_TO_HELP_DOCUMENTATION: list[URLRedirect] = [
URLRedirect("/api/outgoing-webhooks", "/help/outgoing-webhooks"),
URLRedirect("/api/deploying-bots", "/help/deploying-bots"),
+ URLRedirect("/api/running-bots", "/help/running-bots"),
]
API_DOCUMENTATION_REDIRECTS: list[URLRedirect] = [
diff --git a/zerver/tests/test_urls.py b/zerver/tests/test_urls.py
index 6687966c711..7d0cd037beb 100644
--- a/zerver/tests/test_urls.py
+++ b/zerver/tests/test_urls.py
@@ -41,9 +41,6 @@ class PublicURLTest(ZulipTestCase):
url = "/api/" + os.path.splitext(doc)[0] # Strip the extension.
api_doc_urls.append(url)
- # We have lots of api_docs files, so this will be expensive!
- self.assertGreater(len(api_doc_urls), 25)
-
expected_tag = """<meta property="og:description" content="This is an API docs page" />"""
for url in api_doc_urls: