Skip to main content
Registers all bot slash commands with Discord for your server. This command must be run after the bot is first added to a server or after commands are updated. Requires MANAGE_GUILD permission.

Usage

/register
This command requires the MANAGE_GUILD Discord permission. Only server administrators or users with this permission can execute it.

Implementation

src/main.rs:262-268
#[poise::command(prefix_command, required_permissions = "MANAGE_GUILD")]
async fn register(ctx: Context<'_>) -> Result<(), prelude::Error> {
    poise::builtins::register_application_commands_buttons(ctx)
        .await
        .map_err(prelude::Error::Serenity)?;
    Ok(())
}

What This Command Does

The register command performs the following actions:
  1. Interactive Registration: Displays buttons allowing you to choose registration scope
  2. Guild Registration: Registers commands for the current server only (instant)
  3. Global Registration: Registers commands for all servers (takes up to 1 hour)

Registration Process

1

Run the command

Execute /register in your Discord server.
2

Choose scope

Click one of the registration buttons:
  • Register in this guild - Instant, recommended for testing
  • Register globally - Takes up to 1 hour, for production use
3

Confirmation

The bot will confirm successful registration and slash commands will become available.

When to Use

You should run the /register command in these situations:

Initial Setup

When you first add the bot to your Discord server, slash commands won’t appear until you register them.

After Bot Updates

If the bot’s commands are updated (new commands, modified parameters, etc.), you need to re-register for changes to take effect.

Troubleshooting Missing Commands

If slash commands aren’t appearing in Discord’s autocomplete, running /register can fix the issue.

Registration Scopes

Recommended for most users
  • Commands appear instantly after registration
  • Only visible in the current server
  • Perfect for testing and server-specific deployments
  • Can be updated frequently without delay
Click "Register in this guild" button

Automatic Registration

Faculty Bot also performs automatic global registration on startup:
src/main.rs:232-240
.setup(move |ctx, _ready, framework| {
    Box::pin(async move {
        if let Ok(_) =
            poise::builtins::register_globally(ctx, &framework.options().commands).await
        {
            tracing::info!("Successfully registered Application Commands globally");
        } else {
            tracing::error!("Failed to register commands globally");
        }
        // ... rest of setup
    })
})
This means commands are automatically registered globally when the bot starts, though the /register command is still useful for:
  • Instant guild-specific registration
  • Re-registering after making local changes
  • Troubleshooting registration issues

Registered Commands

The following commands will be registered when you run /register: User Commands:
  • /verify (with init and code subcommands)
  • /xp
  • /leaderboard
  • /help
Administration Commands:
  • /getmail
  • /set_xp
  • /force_post_mensaplan
  • /rule (with multiple subcommands)
  • /reverify
  • /run (owner only)
Moderation Commands:
  • Context menu: “Toggle Pin State”
  • Context menu: “Delete Message”
  • /promote_user
  • /demote_user

Permissions

MANAGE_GUILD
Discord Permission
required
The user executing this command must have the MANAGE_GUILD permission in Discord. This is typically reserved for server administrators.

Troubleshooting

  • Wait a few minutes for Discord to sync (especially for global registration)
  • Try restarting your Discord client
  • Ensure the bot has the applications.commands scope
  • Re-run /register and choose guild registration for instant results
You need the MANAGE_GUILD permission in Discord to run this command. Contact your server administrator if you don’t have this permission.
Check the bot logs for error messages. Common issues:
  • Bot token is invalid
  • Bot lacks necessary OAuth scopes
  • Discord API is experiencing issues
This usually indicates a code issue. Verify that:
  • All commands are included in the commands vector in main.rs
  • Commands don’t have syntax errors preventing registration
  • Check bot logs for registration errors

Required Bot Permissions

For slash commands to work properly, ensure your bot has these permissions when added to a server:
  • applications.commands - Required for slash commands
  • bot - Standard bot scope
  • Additional permissions based on what the commands do (e.g., SEND_MESSAGES, MANAGE_ROLES, etc.)

help

View all available commands and their descriptions

Build docs developers (and LLMs) love