10 lines
353 B
TypeScript
10 lines
353 B
TypeScript
import { createEndpoint, createMethodFilter } from "t_rest/server";
|
|
import { bot } from "../bot/mod.ts";
|
|
|
|
export const botRoute = createMethodFilter({
|
|
GET: createEndpoint({ query: null, body: null }, async () => {
|
|
const username = bot.botInfo.username;
|
|
return { status: 200, body: { type: "application/json", data: { username } } };
|
|
}),
|
|
});
|