nocli-handler.js
  • ๐Ÿ”—Links
    • Link to NPM Package
    • Link to Github Package
  • ๐Ÿš€Introduction
    • Welcome
    • Changelog
  • ๐ŸงชGetting Started
    • Setting Up Your Project
  • โ“Guides
    • Instance
      • Providing a MongoDB Connection
      • Things you really need to know
    • Commands
      • Creating a simple "Ping Pong" Command
      • Command Arguments
      • Enabling Slash Commands
      • Deleting a Command
      • Guild and Owner-only Commands
      • Command Aliases
      • Deferring a command reply
      • Running Events inside a Command
      • Command Cooldowns
      • Setting up Autocomplete
      • Required Permissions
  • ๐ŸซClasses
    • NoCliHandler
      • .connectToMongoDB()
    • ChannelCommands
      • .action()
      • .add()
      • .remove()
      • .getAvailableChannels()
    • Command
    • CommandHandler
      • .getValidations()
      • .readFiles()
      • .runCommand()
      • .isCommand()
    • CustomCommands
      • .loadCommands()
      • .create()
      • .delete()
      • .run()
    • DisabledCommands
      • .loadDisabledCommands()
      • .disable()
      • .enable()
      • .isDisabled()
    • PrefixHandler
      • .loadPrefixes()
      • .get()
      • .set()
    • SlashCommands
      • .getCommands()
      • .findCommand()
      • .optionsAreDifferent()
      • .create()
      • .delete()
      • .createOptions()
    • EventHandler
      • .readFiles()
      • .registerEvents()
      • .isEvent()
  • ๐Ÿ› ๏ธUtilities
    • Cooldowns
      • .loadCooldowns()
      • .getKeyFromCooldownUsage()
      • .cancelCooldown()
      • .updateCooldown()
      • .verifyCooldown()
      • .getKey()
      • .canBypass()
      • .start()
      • .canRunAction()
    • handleCommandAutocomplete
    • handleError
    • log
    • getAllFiles
    • importFile
  • ๐Ÿ†ŽDefinitions
    • NoCliCategoryConfiguration
    • NoCliCategoryType
    • ICommand
    • CommandOptions
    • CommandCallbackOptions
    • NoCliCommandCooldown
    • NoCliCommandType
    • cooldownTypesArray
    • NoCliCooldownType
    • NoCliCooldownKeyOptions
    • IEvent
    • EventConfigurationOptions
    • DynamicValidationConfigurationOptions
    • DynamicValidationCheck
    • DynamicValidationCheckFunction
    • NoCliHandlerOptions
    • NoCliCooldownOptions
    • NoCliCooldownConfigOptions
    • MongoDBConnection
    • MongoDBResult
    • DebugOptions
    • ConfigOptions
    • ValidationPluginsOption
    • NoCliEmojiConfigOptions
    • NoCliLanguageType
    • NoCliRuntimeValidationType
    • NoCliSyntaxValidationType
Powered by GitBook
On this page
  1. Getting Started

Setting Up Your Project

Here is a basic example on how to setup your project with nocli-handler.js.

index.js
// Library Imports
const { Client, IntentsBitField, Partials, version } = require('discord.js');
const NoCliHandler = require('nocli-handler.js').default;
const path = require('path');

// Setting Up Client Object
const client = new Client({
    // These intents are recommended for nocli-handler.js to handle commands
    intents: [
        IntentsBitField.Flags.Guilds,
        IntentsBitField.Flags.GuildMessages,
        IntentsBitField.Flags.GuildMessageReactions,
        IntentsBitField.Flags.DirectMessages,
        IntentsBitField.Flags.MessageContent,
        IntentsBitField.Flags.GuildMessageTyping
    ],
    partials: [Partials.Channel, Partials.Message]
});

client.on("ready", () => {
    const instance = new NoCliHandler({
        client,
        configuration: {
            defaultPrefix: "", // Current: !
            commandsDir: path.join(__dirname, 'commands'),
        },
        // clientVersion is required so that nocli-handler.js can help check
        // if you are on the right version as the handler
        language: "JavaScript"
    });
});
index.ts
// Library Imports
import { Client, IntentsBitField, Partials, version } from 'discord.js';
import NoCliHandler from 'nocli-handler.js';
import path from 'path';

// Setting Up Client Object
const client = new Client({
    // These intents are recommended for nocli-handler.js to handle commands
    intents: [
        IntentsBitField.Flags.Guilds,
        IntentsBitField.Flags.GuildMessages,
        IntentsBitField.Flags.GuildMessageReactions,
        IntentsBitField.Flags.DirectMessages,
        IntentsBitField.Flags.MessageContent,
        IntentsBitField.Flags.GuildMessageTyping
    ],
    partials: [Partials.Channel, Partials.Message]
});

client.on("ready", () => {
    const instance = new NoCliHandler({
        client,
        configuration: {
            defaultPrefix: "", // Current: !
            commandsDir: path.join(__dirname, 'commands'),
        },
        // clientVersion is required so that nocli-handler.js can help check
        // if you are on the right version as the handler
        clientVersion: version,
        language: "JavaScript",
        botOwners: ['your_discord_id']
    });
});

PreviousChangelogNextInstance

Last updated 2 years ago

Read the for more information on what the options are for.

๐Ÿงช
Setup Options