@yume.lol/yume.js
v1.1.5
Published
Open yume.lol bot SDK (pure JavaScript, zero API keys). Reads any public profile — avatar, banner, cursor, socials, QR — and lets you build any Discord / Telegram / custom bot with commands you define yourself.
Downloads
44
Maintainers
Readme
@yume.lol/yume.js
The open yume.lol bot SDK — pure JavaScript, zero API keys, zero secrets.
Build any bot you want (Discord, Telegram, Twitch, Slack, webhooks, anything) and register any commands you want. It only reads public profile data — exactly what anyone sees when they open a yume.lol profile: name, avatar, banner, bio, socials, badges, theme/cursor, stats and QR code.
Private and sensitive data is never accessible through this SDK.
Install
npm install @yume.lol/yume.jsRequires Node 18+ (global fetch). No runtime dependencies.
Quick start
Read any public profile
const { createYumeClient } = require("@yume.lol/yume.js");
const yume = createYumeClient(); // no API key
const profile = await yume.getProfile("someone");
console.log(profile.displayName, profile.avatar, profile.views);The returned profile includes:
| Field | Meaning |
| ------------ | ------------------------------------ |
| username | username |
| displayName| display name |
| url | profile URL |
| avatar | avatar image URL |
| banner | banner image URL |
| bio | bio text |
| socials | public social links |
| badges | badges |
| views | profile view count |
| theme | theme / cursor / effect settings |
| qrUrl | QR code image URL |
Convenience getters: getSocials(), getBadges(), getStats(), getTheme(), getQR().
Discord bot (fully open commands)
const { createYumeClient, createDiscordBot, defaultCommands } = require("@yume.lol/yume.js");
const { Client } = require("discord.js");
const yume = createYumeClient();
const client = new Client({ intents: ["Guilds", "GuildMessages", "MessageContent"] });
const bot = createDiscordBot({
client,
yume,
prefix: "!",
commands: [
...defaultCommands(yume), // optional built-ins: profile, socials, stats, badges, qr, theme
{
name: "ping",
description: "Replies with pong",
run: () => "pong 🏓",
},
{
name: "avatar",
description: "Gets a user's public avatar",
usage: "<username>",
run: async (ctx) => {
const p = await ctx.client.getProfile(ctx.args[0]);
return p.avatar ? `🖼 ${p.avatar}` : "No avatar set.";
},
},
],
});
bot.start(process.env.DISCORD_TOKEN);Works with discord.js v13+/v14+, discordeno, oceanic, or any client exposing
client.on("messageCreate", handler).
Telegram bot (zero dependencies, long polling)
const { createYumeClient, createTelegramBot, defaultCommands } = require("@yume.lol/yume.js");
const bot = createTelegramBot({
token: process.env.TELEGRAM_TOKEN,
yume: createYumeClient(),
commands: [...defaultCommands(yume)],
});
bot.startPolling();Any other platform
const { createCommandRouter } = require("@yume.lol/yume.js");
const route = createCommandRouter({
yume,
commands: [
{
name: "hello",
description: "Says hello",
run: (ctx) => `Hello, ${ctx.platform?.user ?? "stranger"}!`,
},
],
});
// wire it into your own chat transport
const { handled, reply } = await route(text, { user: sender }, (t) => send(t));Command API
A command is just:
{
name: "command-name", // required, unique, no spaces
description: "What it does", // shown in /help
usage: "<username>", // optional usage hint
run: async (ctx) => "reply", // returns the reply text
}run receives a context with:
ctx.client— theYumeOpenClient(public data access)ctx.args— argument arrayctx.rest— raw remainder of the messagectx.message— the raw platform messagectx.reply(text)— send a replyctx.platform— platform info (generic router)ctx.commands— the command registry
Throw new YumeError("message", "CODE") to send an error reply.
What is NOT accessible
- Email, password, secrets, tokens, private data of any kind
- Anything behind "require login to view" (private profiles return an error)
- Account mutation endpoints (the SDK is read-only by design)
API
createYumeClient({ baseUrl?, timeout? }) → YumeOpenClient
getProfile(username)→ full public profilegetSocials(username)→ social linksgetBadges(username)→ badges arraygetStats(username)→{ views }getTheme(username)→ theme/cursor settingsgetQR(username)→ QR image URLping()→trueif reachable
createCommandRegistry(commands) → registry with add, get, has, list.
defaultCommands(client) → optional built-in commands (profile, socials,
stats, badges, qr, theme).
attachDiscord(options) / createDiscordBot(options) → Discord adapter.
YumeTelegram(options) / createTelegramBot(options) → Telegram adapter
(startPolling, handleUpdate, sendMessage, stop).
createCommandRouter({ yume, commands, prefix }) → generic router returning
{ handled, reply }.
Test
npm test