lunacord.js
v1.0.0-beta
Published
Lunacord umbrella: re-exports @lunacord/* plus createLunacordMusicClient() preset for discord.js bots.
Readme
lunacord.js
Umbrella package for Lunacord: it re-exports the scoped libraries and exposes a small preset for discord.js bots.
Install
bun add lunacord.js discord.js
# optional, for Redis cache / persistence
bun add redisRe-exports (main entry)
import { … } from "lunacord.js" includes:
- Everything from
@lunacord/core MusicKitand related discord.js types from@lunacord/discordjs- Plugin builtins from
@lunacord/plugins(createLoggerPlugin,createDebugPlugin, …) — core types likePluginBuilderalready come from@lunacord/core - Lyrics clients from
@lunacord/lyrics - Redis helpers from
@lunacord/cache-redis
For smaller installs and explicit boundaries, depend on @lunacord/* packages directly instead.
Subpath barrels (optional)
| Import | Same as |
|--------|---------|
| lunacord.js/plugins | @lunacord/plugins |
| lunacord.js/lyrics | @lunacord/lyrics |
| lunacord.js/cache | @lunacord/cache-redis |
Preset: createLunacordMusicClient
Builds a Client with default music intents and a MusicKit wired like MusicKit.create(client, options).
import { createLunacordMusicClient, createLoggerPlugin } from "lunacord.js";
const { client, music } = createLunacordMusicClient({
nodes: [{ id: "main", host: "localhost", port: 2333, password: "youshallnotpass" }],
logger: console,
plugins: [createLoggerPlugin({ name: "observer", version: "1.0.0" })],
onReady: async () => {
await music.commands.installDefaults();
},
});
await client.login(process.env.DISCORD_TOKEN);Override Discord intents via discord.intents if you need more than Guilds and GuildVoiceStates.
Migration
See the migration guide if you are moving from older layouts.
