UNPKG

wranglebot

Version:

open source media asset management

22 lines (19 loc) 615 B
import LogBot from "logbotjs"; import type { WrangleBot } from "../../../core/WrangleBot.js"; import { SocketServer } from "../../SocketServer.js"; import RouteResult from "../../RouteResult.js"; /** * @description Retrieves the balance that is associated with the authenticated user */ export default { method: "get", url: "/users/me/balance", handler: async (req, res, bot: WrangleBot, server: SocketServer) => { if (!bot.ML) { return new RouteResult(404, "Machine Learning module not loaded"); } return new RouteResult(200, { balance: await bot.ML.getBalance(), }); }, };