constatic
Version:
Constatic is a CLI for creating and managing modern TypeScript projects, providing an organized structure and features that streamline development.
22 lines (21 loc) • 687 B
JavaScript
// src/shared/tokens.ts
import { getDiscordBotInfo, uiMessage } from "#helpers";
import { Result } from "#lib/result.js";
import ck from "chalk";
import ora from "ora";
async function fetchDiscordTokenData(token) {
const fetching = ora();
fetching.start(uiMessage({
"en-US": "\uD83D\uDD0D Fetching token information...",
"pt-BR": "\uD83D\uDD0D Buscando informações do token..."
}));
const r = await getDiscordBotInfo(token);
fetching.stop();
return r.success ? Result.ok({ token, ...r.data }) : Result.fail(uiMessage({
"en-US": "The provided token is invalid",
"pt-BR": "O token informado é inválido!"
}, ck.red));
}
export {
fetchDiscordTokenData
};