diff --git a/manifest.json b/manifest.json new file mode 100644 index 0000000..cc0a0b1 --- /dev/null +++ b/manifest.json @@ -0,0 +1,11 @@ +{ + "name": "Query user", + "description": "Queries a user and retrieves its related information, such as the wallet, the label access control, or the current XP.", + "ubiquity:listeners": [ "issue_comment.created" ], + "commands": { + "query": { + "ubiquity:example": "/query @ubiquibot", + "description": "Returns the user's wallet, access, and multiplier information." + } + } +} diff --git a/src/worker.ts b/src/worker.ts index 00befd9..bbfb6a7 100644 --- a/src/worker.ts +++ b/src/worker.ts @@ -2,10 +2,19 @@ import { Value } from "@sinclair/typebox/value"; import { run } from "./run"; import { Env } from "./types/env"; import { commandQueryUserScheme } from "./types/plugin-input"; +import manifest from "../manifest.json"; export default { async fetch(request: Request, env: Env): Promise { try { + if (request.method === "GET") { + const url = new URL(request.url); + if (url.pathname === "/manifest.json") { + return new Response(JSON.stringify(manifest), { + headers: { "content-type": "application/json" }, + }); + } + } if (request.method !== "POST") { return new Response(JSON.stringify({ error: `Only POST requests are supported.` }), { status: 405,