@@ -5,7 +5,7 @@
|
||||
"synopsis": [
|
||||
"# reference — not a shell command"
|
||||
],
|
||||
"description": "Documents BARE_OS_BARE_MODULES and BARE_OS_BARE_DRIVE_BUNDLES for the booter ctx.bare registry. In-image scripts (AsyncFunction) use ctx.bare.<key> instead of import(). Keys come from host dynamic import of packages listed in packages/bare-os-booter/lib/bare-module-manifest.json, then optional merge from trusted IIFE bundles under /lib/bare/bundles/ on the system image (see manifest.json there). Set BARE_OS_BARE_MODULES=0 to omit ctx.bare entirely. Set BARE_OS_BARE_DRIVE_BUNDLES=0 to skip executing drive bundles (host imports only). Rebuild bundles with npm run build -w bare-os-bare-libs.",
|
||||
"description": "Documents BARE_OS_BARE_MODULES and BARE_OS_BARE_DRIVE_BUNDLES for the booter ctx.bare registry. In-image scripts (AsyncFunction) use ctx.bare.<key> instead of import(). Keys come from host dynamic import of packages listed in packages/bare-os-booter/lib/bare-module-manifest.json, then optional merge from trusted IIFE bundles under /lib/bare/bundles/ on the system image (see manifest.json there). The booter also attaches ctx.bare.discordJS from vendored bare-discord-js (official discord.js on Bare) unless BARE_OS_DISCORD=0. Set BARE_OS_BARE_MODULES=0 to omit ctx.bare entirely. Set BARE_OS_BARE_DRIVE_BUNDLES=0 to skip executing drive bundles (host imports only). Rebuild bundles with npm run build -w bare-os-bare-libs.",
|
||||
"options": [],
|
||||
"keywords": [
|
||||
"BARE_OS_BARE_MODULES",
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
{
|
||||
"name": "discord-bot",
|
||||
"section": 1,
|
||||
"title": "discord-bot",
|
||||
"synopsis": [
|
||||
"discord-bot [--env PATH] [--token TOKEN] [--guild ID] [--check]"
|
||||
],
|
||||
"description": "Foreground Discord ping-pong bot using ctx.bare.discordJS (vendored bare-discord-js / official discord.js). Replies pong to the /ping slash command and to the message ping. Token comes from --token, guest DISCORD_TOKEN, a VFS .env file (--env, DISCORD_ENV_FILE, ~/.discord.env), or a host DISCORD_ENV_FILE / DISCORD_TOKEN copied into the session by the booter. Enable MESSAGE CONTENT INTENT in the Discord Developer Portal for channel message ping/pong; /ping works without that privileged intent. Custom bots should use ctx.bare.discordJS.Client the same way (see examples/discord-ping-pong).",
|
||||
"options": [
|
||||
{
|
||||
"flag": "--env PATH",
|
||||
"meaning": "VFS path to a .env file containing DISCORD_TOKEN=... (also --env-file)."
|
||||
},
|
||||
{
|
||||
"flag": "--token TOKEN",
|
||||
"meaning": "Bot token (Developer Portal → Bot → Token). Prefer a .env file."
|
||||
},
|
||||
{
|
||||
"flag": "--guild ID",
|
||||
"meaning": "Guild id for instant /ping registration (else global, up to ~1 hour)."
|
||||
},
|
||||
{
|
||||
"flag": "--check",
|
||||
"meaning": "Verify ctx.bare.discordJS and that a token can be resolved; do not login."
|
||||
}
|
||||
],
|
||||
"keywords": ["discord", "bot", "ping", "pong", "ctx.bare"],
|
||||
"environment": [
|
||||
"DISCORD_TOKEN — bot token in the guest session (also copied from the host when set).",
|
||||
"DISCORD_ENV_FILE / BARE_OS_DISCORD_ENV_FILE — path to a .env file. On the host this may be a host filesystem path (booter reads it). In the guest it is a VFS path.",
|
||||
"DISCORD_GUILD_ID — optional guild for slash-command registration.",
|
||||
"BARE_OS_DISCORD — set 0 / false to skip loading ctx.bare.discordJS.",
|
||||
"BARE_OS_BARE_MODULES — set 0 to omit ctx.bare entirely."
|
||||
],
|
||||
"seeAlso": [
|
||||
{
|
||||
"name": "bare-os-ctx-bare",
|
||||
"section": 7
|
||||
}
|
||||
],
|
||||
"bareOsNotes": "Requires a Bare/Pear host so vendored bare-discord-js can remap Node builtins. Guest scripts have no import/require; use ctx.bare.discordJS.",
|
||||
"examples": [
|
||||
{
|
||||
"caption": "check token resolution without connecting",
|
||||
"code": "discord-bot --check --env ~/.discord.env"
|
||||
},
|
||||
{
|
||||
"caption": "run the ping-pong bot",
|
||||
"code": "discord-bot --env ~/.discord.env --guild 123456789012345678"
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user