Packages@robojs/discordjs
DIRECTORY
API reference for @robojs/discordjs
@robojs/discordjs
API reference documentation for @robojs/discordjs.
Interfaces
AggregatedPermissions- Aggregated permission information for a command.BaseConfig- Base configuration shared by all handler types.CommandConfig- Command configuration options.CommandController- Command controller for portal.discordjs.command().CommandDefaults- Default command/context menu configuration.CommandEntry- Command entry in manifest (includes subcommands).Command- Command module structure expected in handler files.CommandsNamespaceController- Namespace controller for portal.discord.commands.ContextConfig- Context menu configuration options.ContextController- Context menu controller for portal.discordjs.context().ContextNamespaceController- Namespace controller for portal.discordjs.context.Context- Context menu module structure expected in handler files.DiscordConfig- Discord plugin configuration.DiscordPortalNamespace- Discord namespace on the portal.DiscordjsAggregatedMetadata- Aggregated Discord metadata with full traceability.EventConfig- Event configuration options.EventController- Event controller for portal.discord.event().Event- Event module structure expected in handler files.EventsNamespaceController- Namespace controller for portal.discord.events.MiddlewareChainEntry- Middleware chain entry with handler and metadata.MiddlewareConfig- Middleware configuration options.MiddlewareController- Middleware controller for portal.discord.middleware().MiddlewareData- Middleware data passed to handler.MiddlewareNamespaceController- Namespace controller for portal.discord.middleware.MiddlewareResult- Middleware result that can abort or modify processing.Middleware- Middleware module structure expected in handler files.PluginState- Plugin state interface for internal storage.RegisterCommandsOptions- Options for command registration.RetryEntry- Retry tracking entry for telemetry/debugging.SageOptions- Sage (auto-defer/reply) options for commands and context menus.TimeoutConfig- Timeout configuration for various operations.
Type Aliases
AutocompleteHandler- Autocomplete handler function type.BaseValueOfOption- Maps an option's discriminant type to its runtime value viaCommandOptionTypes.ChoiceUnionOfOption- For an optionK, produces a union of allchoices[].valueliterals.ChoiceValueOf- Extracts the literalvaluetype from a single choice entry.CommandContext- Interaction context types.CommandHandler- Command handler function type.CommandIntegrationType- Integration/installation types.CommandOptionTypes- Map of option type names to their resolved TypeScript types.CommandOption- Command option with discriminated union for channel type.CommandOptions- Infer options type from command config.CommandResult- Command result type (what can be returned from a command).ContextEntry- Context menu entry in manifest.ContextHandler- Generic context handler (either user or message).ContextTypeValueDiscordEventName- Discord.js event names.EnforceConfig- Enforces that no extra properties exist beyond CommandConfig.EnforceContextConfig- Enforces that no extra properties exist beyond ContextConfig.EventEntry- Event entry in manifest.EventHandler- Event handler function type.ExactConfig- Ensures the config only contains valid CommandConfig properties.ExactContextConfig- Ensures the config only contains valid ContextConfig properties.MessageContextHandler- Context menu handler function type (message context).MiddlewareEntry- Middleware entry in manifest.MiddlewareHandler- Middleware handler function type.SmartCommandConfig- Smart command config type that enables TypeScript to infer option types.SmartContextConfig- Smart context config type that enables TypeScript validation.TypeNameOfOption- Gets the discriminant "type name" of an optionK.UserContextHandler- Context menu handler function type (user context).ValueOfOption- The final value type for an optionK.
Functions
AddOptionToCommandBuilder- Add an option to a command or subcommand builder.AggregateCommandPermissions- Aggregate permissions from command entries.AggregateContextPermissions- Aggregate permissions from context menu entries.BuildContextCommands- Build context menu commands for Discord API.BuildSlashCommands- Build slash commands for Discord API.CheckIntents- Check if the client has the required intents for registered events.CombinePermissions- Combine multiple permission bitfields.CreateCommandConfig- Creates a command configuration with proper type inference.CreateCommandsNamespaceController- Create a namespace controller for commands.CreateContextConfig- Creates a context menu configuration with proper type validation.CreateContextNamespaceController- Create a namespace controller for context menus.CreateEventsNamespaceController- Create a namespace controller for events.CreateMiddlewareNamespaceController- Create a namespace controller for middleware.ExecuteAutocompleteHandler- Execute an autocomplete handler.ExecuteCommandHandler- Execute a slash command handler.ExecuteContextHandler- Execute a context menu handler.ExecuteEventHandler- Execute all handlers for an event.ExtractCommandOptions- Extract command options from a Discord interaction.FindCommandDifferences- Find differences between old and new command sets.GetClient- Get the Discord client instance.GetCommandKey- Get the command key from an interaction (including subcommands).GetContextType- Convert CommandContext to InteractionContextType.GetEffectivePermissions- Get effective permissions for a command in a specific guild.GetIntegrationType- Convert CommandIntegrationType to ApplicationIntegrationType.GetIntentNames- Get intent names from a set of intent bits.GetMissingPermissions- Get missing permissions for a user.GetPermissionNames- Get permission names from a bitfield.GetSage- Get effective Sage options from command config and plugin config.HandleInteraction- Handle an incoming Discord interaction.HasClient- Check if the Discord client is initialized.HasRequiredPermissions- Validate that a user has the required permissions for a command.InferIntents- Infer required intents from a list of event names.RegisterCommandsToDiscord- Register commands with Discord API.RegisterCommands- High-level command registration function.SetGuildPermissionOverride- Set a guild-specific permission override for a command.ValidateIntents- Validate that all required intents are present for given events.
Variables
Commands- Namespace controller for commands - access all commands, execute programmatically.ContextType- Discord ApplicationCommandType values for context menus.Context- Namespace controller for context menus - access all context menus.DiscordLogger- Plugin-wide logger instance.Events- Namespace controller for events - access all events, emit programmatically.Flashcore_key_command_hash_prefix- Flashcore key prefix for caching command hashes.Flashcore_key_command_register_error- Flashcore key for tracking command registration errors.Middleware- Namespace controller for middleware - access middleware chain.Permission_flags- Map of permission names to their bitfield values.Required_intents- Mapping of Discord event names to their required gateway intents.
