nyx Typedoc
    Preparing search index...

    Module @nyx-discord/djs - v1.1.0

    @nyx-discord/djs


    @nyx-discord/djs is the discord.js adapter for nyx, a Discord bot framework that stays out of your way. It handles application commands, components, events, schedules and plugins on top of your discord.js client.

    It re-exports everything from @nyx-discord/base, so it's the only nyx package you need to install.

    npm i @nyx-discord/djs discord.js
    
    import { AbstractStandaloneCommand, Bot } from '@nyx-discord/djs';
    import { Client, GatewayIntentBits, SlashCommandBuilder, type ChatInputCommandInteraction } from 'discord.js';

    class PingCommand extends AbstractStandaloneCommand {
    protected readonly data = new SlashCommandBuilder().setName('ping').setDescription('Pong!').toJSON();

    public async execute(interaction: ChatInputCommandInteraction) {
    await interaction.reply('Pong!');
    }
    }

    const bot = Bot.create(() => ({
    token: process.env['DISCORD_TOKEN']!,
    client: new Client({ intents: [GatewayIntentBits.Guilds] }),
    logger: console,
    deployCommands: true,
    }));

    await bot.getCommandManager().addCommands(new PingCommand());
    await bot.start();
    AbstractBusSubscriber
    AbstractChildableCommand
    AbstractCommand
    AbstractCommandFilter
    AbstractCommandMiddleware
    AbstractCommandSubscriber
    AbstractContextMenuCommand
    AbstractCustomIdCodec
    AbstractDJSClientSubscriber
    AbstractEventDispatcher
    AbstractEventSubscriber
    AbstractEventSubscriberFilter
    AbstractEventSubscriberMiddleware
    AbstractExecutableCommand
    AbstractFilter
    AbstractFilterAggregator
    AbstractMiddleware
    AbstractMiddlewareList
    AbstractParentCommand
    AbstractPluginSubscriber
    AbstractSchedule
    AbstractScheduleFilter
    AbstractScheduleMiddleware
    AbstractScheduleSubscriber
    AbstractServiceSubscriber
    AbstractStandaloneCommand
    AbstractSubCommand
    AbstractSubCommandGroup
    AndFilter
    AssertionError
    BaseBot
    BaseChildableCommand
    BaseClientSubscriber
    BaseCommand
    BaseCommandFilter
    BaseCommandMiddleware
    BaseCommandSubscriber
    BaseContextMenuCommand
    BaseExecutableCommand
    BaseParentCommand
    BaseStandaloneCommand
    BaseSubCommand
    BaseSubCommandGroup
    BasicAsyncEventDispatcher
    BasicErrorHandler
    BasicEventBus
    BasicEventEmitterBus
    BasicFilterCheckMiddleware
    BasicSyncEventDispatcher
    Bot
    CommandAutocompleteError
    CommandError
    CommandFilterCheckMiddleware
    CommandMiddlewareError
    CommandMiddlewareList
    CronJobAdapter
    DefaultBotService
    DefaultCommandAutocompleteSubscriber
    DefaultCommandCustomIdCodec
    DefaultCommandDeployer
    DefaultCommandExecutor
    DefaultCommandInteractionSubscriber
    DefaultCommandManager
    DefaultCommandRepository
    DefaultCommandResolver
    DefaultCommandSubscriptionsContainer
    DefaultMetadataFactory
    DefaultPluginManager
    DefaultScheduleExecutionScheduler
    DefaultScheduleExecutor
    DefaultScheduleManager
    DefaultScheduleRepository
    DjsNyxClient
    EventSubscriberMiddlewareError
    FalseFilter
    FeatureError
    HandleCheckEventMiddleware
    IllegalDuplicateError
    IllegalStateError
    LifetimeCheckEventMiddleware
    NotFilter
    NotImplementedError
    ObjectNotFoundError
    OrFilter
    PluginAddError
    ProtectedObjectError
    ScheduleFilterCheckMiddleware
    ScheduleMiddlewareError
    ScheduleMiddlewareList
    SubscriberCallbackWrapper
    SubscriberFilterCheckMiddleware
    SubscriberMiddlewareList
    TimerJobAdapter
    TrueFilter
    UncaughtCommandMiddlewareError
    UncaughtEventSubscriberMiddlewareError
    UncaughtScheduleMiddlewareError
    AsyncEventDispatcher
    BotLifecycleObserver
    BotOptions
    BotService
    BotServiceEventArgs
    ChatExecutableCommand
    ChildableCommand
    ChildCommand
    Command
    CommandCustomIdCodec
    CommandDeployer
    CommandErrorHandler
    CommandEventArgs
    CommandExecutor
    CommandFilter
    CommandManager
    CommandMiddleware
    CommandRepository
    CommandResolver
    CommandSubscriptionsContainer
    ContextMenuCommand
    CustomIdCodec
    DjsInteractionTypes
    ErrorHandler
    ErrorHandlerContainer
    EventBus
    EventBusEventArgs
    EventDispatcher
    EventEmitterBus
    EventEmitterLike
    EventSubscriber
    EventSubscriberErrorHandler
    EventSubscriberFilter
    EventSubscriberMiddleware
    ExecutableCommand
    Filter
    Filterable
    Identifiable
    InteractionTypes
    Metadatable
    MetadataFactory
    Middleware
    MiddlewareList
    MiddlewareListContainer
    Nameable
    NyxBot
    NyxClient
    NyxLogger
    NyxPlugin
    ParentCommand
    PluginEventArgs
    PluginManager
    PriorityAware
    Protectable
    ReadonlyCommandRepository
    ReadonlyScheduleExecutionScheduler
    ReadonlyScheduleRepository
    Schedule
    ScheduleErrorHandler
    ScheduleEventArgs
    ScheduleExecutionScheduler
    ScheduleExecutor
    ScheduleFilter
    ScheduleJobAdapter
    ScheduleManager
    ScheduleMiddleware
    ScheduleRepository
    StandaloneCommand
    SubCommand
    SubCommandGroup
    SyncEventDispatcher
    UndestroyableScheduleJobAdapter
    AnyClass
    AnyEventBus
    AnyEventSubscriber
    AnyEventSubscriberFrom
    AnyExecutableCommand
    ApplicationCommandCollection
    ApplicationCommandInteraction
    Awaitable
    BotServiceEvent
    BotStatus
    ClassImplements
    CommandCustomIdData
    CommandEvent
    CommandExecutableInteraction
    CommandExecutionArgs
    CommandFilterResolvable
    CommandMiddlewareResolvable
    CommandResolvableInteraction
    Comparator
    ComponentCommandInteraction
    Constructor
    DefaultScheduleJob
    DjsAnyExecutableCommand
    DjsBotDependencies
    DjsCommandErrorHandler
    DjsCommandEventArgs
    DjsCommandExecutableInteraction
    DjsCommandExecutionArgs
    DjsCommandFilterResolvable
    DjsCommandInteraction
    DjsCommandMiddlewareResolvable
    DjsCommandResolvableInteraction
    DjsComponentInteraction
    DjsNyxBot
    ErrorConsumer
    ErrorConsumerCollection
    EventBusEvent
    EventDispatchArgs
    EventSubscriberCollection
    EventSubscriberFilterResolvable
    EventSubscriberLifetime
    EventSubscriberMiddlewareResolvable
    FilterResolvable
    FilterResolvableFrom
    Identifier
    ImplementsParentCommand
    ImplementsStandaloneCommand
    ImplementsSubCommand
    ImplementsSubCommandGroup
    InjectableBotDependencies
    Metadata
    MiddlewareResolvable
    MiddlewareResolvableFrom
    MiddlewareResponse
    NyxPluginData
    PluginEvent
    Priority
    ReadonlyCollectionFrom
    ReadonlyCommandDeployer
    ReadonlyMetadata
    ScheduleEvent
    ScheduleFilterResolvable
    ScheduleInterval
    ScheduleJobParams
    ScheduleMiddlewareResolvable
    ScheduleTickArgs
    SerializableFeature
    SubCommandData
    SubCommandGroupData
    Tail
    TimerJobHandle
    TopLevelCommand
    TypedField
    BotServiceEventEnum
    BotStatusEnum
    CommandEventEnum
    EventBusEventEnum
    EventSubscriberLifetimeEnum
    PluginEventEnum
    PriorityEnum
    ScheduleEventEnum
    SerializableFeatureEnum
    TypedFields
    canBeIdentifier
    ensureKey
    getCommandNameTree
    DjsBot → Bot