Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,16 @@ npm install
npm run register
```

Command registration mode

OmegaBot supports two registration modes:

- Guild registration (recommended for development)
If DISCORD_GUILD_ID is set, commands are registered to that guild and appear immediately.

- Global registration
If DISCORD_GUILD_ID is not set, commands are registered globally and may take up to 1 hour to appear.

5. Run the bot locally:

```bash
Expand Down Expand Up @@ -307,4 +317,4 @@ If you would like to contribute, please open an issue or submit a pull request.

## License

MIT License. Use and modify freely.
MIT License. Use and modify freely.
10 changes: 8 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"dependencies": {
"discord.js": "^14.14.1",
"dotenv": "^16.4.5",
"jiti": "^2.6.1",
"openai": "^4.0.0",
"pino": "^10.1.0"
},
Expand Down
9 changes: 8 additions & 1 deletion src/registerCommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ async function loadCommandData(): Promise<
if (mod?.data && typeof mod.execute === "function") {
const json = mod.data.toJSON();

// 👇 Log exactly what is being registered
logger.info(
{
command: json.name,
Expand Down Expand Up @@ -101,6 +100,14 @@ async function register(): Promise<void> {
"Final slash command payload",
);

logger.info(
{
mode: env.guildId ? "guild" : "global",
guildId: env.guildId ?? undefined,
},
"Slash command registration mode",
);

if (env.guildId) {
await rest.put(Routes.applicationGuildCommands(env.appId, env.guildId), {
body: commands,
Expand Down