Socket
Book a DemoInstallSign in
Socket

discord-kommando.js

Package Overview
Dependencies
Maintainers
2
Versions
82
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

discord-kommando.js

An automatic interaction handler for discord.js

latest
Source
npmnpm
Version
2.2.0
Version published
Maintainers
2
Created
Source

discord-kommando.js

An automatic interaction handler for discord.js

Supported discord.js versions

VersionStatus
v13Removed
v14Supported

Tutorial

JavaScript

Just.. Copy it!

// CommonJS
const { KommandoClient } = require('discord-kommando.js/v14');

// ESM
import { KommandoClient } from 'discord-kommando.js/v14';

const client = new KommandoClient({ directory: "src/kommando" });

client.login('your-token-goes-here');

TypeScript

You need to change tsconfig.json before using it.

{
    "compilerOptions": {
        "moduleResolution": "NodeNext"
    }
}

And copy it to your main file...

import { KommandoClient } from 'discord-kommando.js/v14';

const client = new KommandoClient({ directory: "dist/kommando" });

client.login('your-token-goes-here');

Adding commands

Copy and add this code into (directory in your client constructor)/commands folder

// Import the 'Command' class

const command = new Command({
    name: "first_command",
    description: "description (required)",
    options: [
        { name: "first_option", description: "description (required)", type: "string" }
    ]
});

command.handle(async itr => {
    // Do something
});

// Export it.
module.exports = command;

// Or ESM, Typescript?
export default command;

Documentation

Documentation link

Keywords

discord.js

FAQs

Package last updated on 10 Jun 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts