Skip to content

Commit

Permalink
Merge pull request #11 from gentlementlegen/development
Browse files Browse the repository at this point in the history
Manifest file
  • Loading branch information
gentlementlegen authored Jul 17, 2024
2 parents 395341b + 46e194a commit d178986
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
11 changes: 11 additions & 0 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -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."
}
}
}
9 changes: 9 additions & 0 deletions src/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<Response> {
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,
Expand Down

0 comments on commit d178986

Please sign in to comment.