OpenDomains Discord interface built with discord.js.
- Node.js 18.17+ and npm.
- A Discord application with a bot token.
- Copy
.env.exampleto.envand fill inDISCORD_TOKEN,CLIENT_ID, and optionallyGUILD_IDfor guild-scoped development commands. - Install dependencies:
npm install
- Register slash commands (guild registration is faster for iteration):
npm run register
- Run the bot:
npm start
/ping– health check for the bot./about– quick context on the OpenDomains bot./login– start device-based authentication with OpenDomains and store the session in MongoDB./logout– clear your stored OpenDomains session/API key./domains– list your domains and their statuses.
- MongoDB connection string in
MONGO_URI(and optionalMONGO_DB_NAMEoverride). - The device auth endpoints default to
https://beta.open-domains.net/apiwith/device-authand/device-auth/poll. Override withOPEN_DOMAINS_API_BASE,OPEN_DOMAINS_DEVICE_START_PATH, orOPEN_DOMAINS_DEVICE_POLL_PATHif the service uses different paths. - The domains listing endpoint defaults to
/domains. Override withOPEN_DOMAINS_DOMAINS_PATHif needed. - For offline testing, set
OPEN_DOMAINS_MOCK_DEVICE_AUTH=trueto return dummy device codes and a mock API key without calling the real service.
Add new commands by creating files in src/commands/ that export command = { data, execute }. Commands are auto-loaded by both the runtime and the registration script.