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

discot

Package Overview
Dependencies
Maintainers
1
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

discot

Simple discord bot creation framework.

  • 1.3.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

discot-logo

Node CI npm npm NPM

Create simple, yet powerful discord bots focusing on commands.

What is it ?

Discot is a wrapper around discord.js to simplify the creation of server bots. It permists to focus on the creation of commands instead of spending time working with discord's API.

Usage

Installation

Discot can be installed using yarn or npm.

npm install discot
# or
yarn add discot

Example

const bot = new Bot({
    token: 'discord_token', // default value: process.env.DISCORD_TOKEN
    prefix: '!'             // default value: '!'
});

bot.addCommand({
        name: 'ping',
        description: 'Reply pong',
        action: message => message.channel.send('pong')
    })
    .addCommand({
        name: 'say',
        description: 'Send the text passed as first argument. Usage: "!say hello"',
        action: (message, args) => message.channel.send(args[0]),
        requiredArgCount: 0
    })
    .start(() => console.log('Bot started.'));

discord-example

message in the action method for a command is the object from discord.js

API

Bot constructor
const bot = new Bot({
    token: 'discord_token', // default value: process.env.DISCORD_TOKEN
    prefix: '!'             // default value: '!'
});

Set your discord token in the env variable DISCORD_TOKEN (use dotenv).

bot.addCommand(command)
bot.addCommand({
    name: 'ping',              // name of the command, the one to type
    description: 'Reply pong', // description displayed in the help message
    action: message => message.channel.send('pong'), // action to execute when the command is triggered
    requiredArgCount: 1        // amount of required parameters for the command for validation
})                             

message in the action method for a command is the object from discord.js

bot.start(callback?)
bot.start(() => console.log('Bot started.'))

The callback is triggered when the bot is started.

Contribute

Pull requests are welcome ! Feel free to contribute.

Credits

Coded with ❤️ by Corentin Thomasset.

License

This project is under the MIT license.

Keywords

FAQs

Package last updated on 26 Sep 2020

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