From 7eb1cf48f8cba63ed3975cfea1dcf281c48b33f7 Mon Sep 17 00:00:00 2001 From: Mirasaki Date: Fri, 24 Feb 2023 10:22:03 +0100 Subject: [PATCH 1/2] add api-docs markdown tutorial --- jsdoc.json | 2 +- tutorials/api-docs.md | 97 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 98 insertions(+), 1 deletion(-) create mode 100644 tutorials/api-docs.md diff --git a/jsdoc.json b/jsdoc.json index d30fdb5..b155692 100644 --- a/jsdoc.json +++ b/jsdoc.json @@ -45,7 +45,7 @@ "id":"repository" }, "API Documentation": { - "href": "/api-docs", + "href": "/tutorial-api-docs", "class": "menu-item", "id": "api-documentation" }, diff --git a/tutorials/api-docs.md b/tutorials/api-docs.md new file mode 100644 index 0000000..5209522 --- /dev/null +++ b/tutorials/api-docs.md @@ -0,0 +1,97 @@ +# Commands + +## URL Query Parameters + +The following URL Query parameter apply to all subsequent command routes **without a /:name parameter** + +```json +{ + "category": "The category to filter by", + "limit": "The maximum amount of commands to return" +} + +``` + +## Chat Input Commands + +GET all application Chat Input commands + +**URL** : `/api/commands` + +**Find by name** : `/api/commands/:name` + +**Method** : `GET` + +**Response Code** : `200 OK` + +**Response Content** : Returns an array of client Chat Input commands with your specified command structure + +## Context Menu Commands + +GET all application Context Menu Commands + +**URL** : `/api/commands/context-menus` + +**Find by name** : `/api/commands/context-menus/:name` + +**Method** : `GET` + +**Response Code** : `200 OK` + +**Response Content** : Returns an array of client Context Menu Commands with your specified command structure + +## Auto-complete options + +GET all application Auto-complete options + +**URL** : `/api/commands/auto-complete` + +**Find by name** : `/api/commands/auto-complete/:name` + +**Method** : `GET` + +**Response Code** : `200 OK` + +**Response Content** : Returns an array of client Auto-complete options with your specified command structure + +## Button Actions + +GET all application Button Actions + +**URL** : `/api/commands/buttons` + +**Find by name** : `/api/commands/buttons/:name` + +**Method** : `GET` + +**Response Code** : `200 OK` + +**Response Content** : Returns an array of client Button Actions with your specified command structure + +## Modal Prompts + +GET all application Modal Prompts + +**URL** : `/api/commands/modals` + +**Find by name** : `/api/commands/modals/:name` + +**Method** : `GET` + +**Response Code** : `200 OK` + +**Response Content** : Returns an array of client Modal Prompts with your specified command structure + +## Select Menu's + +GET all application Select Menu's + +**URL** : `/api/commands/select-menus` + +**Find by name** : `/api/commands/select-menus/:name` + +**Method** : `GET` + +**Response Code** : `200 OK` + +**Response Content** : Returns an array of client Select Menu's with your specified command structure From c0411d424f4229b828b6dca6fa268524f3482b97 Mon Sep 17 00:00:00 2001 From: Mirasaki Date: Fri, 24 Feb 2023 10:22:56 +0100 Subject: [PATCH 2/2] update api-docs link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6c32518..9bf47d3 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ Come try the template yourself in our official [support server](https://discord.

Documentation

- The client (bot) code is documented at [djs.mirasaki.dev](https://djs.mirasaki.dev "Client Documentation") -- The API is documented at [djs.mirasaki.dev/api-docs](https://djs.mirasaki.dev/api-docs "Backend/API Documentation") +- The API is documented at [djs.mirasaki.dev/api-docs](https://djs.mirasaki.dev/tutorial-api-docs "Backend/API Documentation") - Source code is well documented with comments, explaining what's going on - With the use of JSDoc for client documentation, enjoy code-completion (IntelliSense) in your favorite code editor