Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@kcp/functions

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@kcp/functions

A basic plugin which adds reloadable functions to Klasa

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5
increased by66.67%
Maintainers
1
Weekly downloads
 
Created
Source

NPM version NPM downloads Install Size Build Status

NPM info

Functions

A simple Klasa plugin which adds reloadable functions to your Klasa Bot

How To Use

  1. Install the plugin.
npm i @kcp/functions

# If you use yarn
yarn add @kcp/functions
  1. Use @kcp/functions in your client.
const { Client } = require("klasa");
Client.use(require("@kcp/functions"));

new Client({ aliasFunctions: { returnMethod: "run", prefix: "funcs", enabled: true } }).login("Your Beautiful Token");

If you use TypeScript

import { Client } from 'klasa';
import { Client as FunctionsClient } from '@kcp/functions';

Client.use(FunctionsClient);

new Client({ aliasFunctions: { returnMethod: "run", prefix: "funcs", enabled: true } }).login("Your Beautiful Token");
  1. Create a new function in your functions folder with the name you want to access later, for example test.js or test.ts.
const { Function } = require("@kcp/functions");

module.exports = class extends Function {
    run() {
        // Your Code Here
    }
}
  1. Use these functions in your bot.
this.client.funcs.test();
  1. ???... Enjoy!

Tips

  • To allow multiple functions in a file so you can do something like this.client.funcs.utils.toTitleCase(string) instead of using 1 file per function remove the returnMethod.

License

This project is under the MIT license.

FAQs

Package last updated on 17 Apr 2019

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc