LachlanDev / Discord-BOT-Template

A template used to start developing a Discord BOT in Node.JS.

Home Page:https://lachlan-dev.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool



Discord BOT Template

This is a template used to start developing a Discord BOT in Node.JS.

Setup

  • Download the repo
  • Edit the config.json adding your BOT's token and desired prefix.
  • Start the BOT using the commmand node main.js in the same directory as main.js

Folder Structure

├── cfg
│   └── config.json
├── commands
│   ├── help.js
│   └── Other commands here. (Filename = command usage)
├── events
│   ├── message.js
│   └── ready.js
├── node_modules
│   └── All modules are included in source code.
├── main.js
├── package-lock.json
└── package.json

Creating Commands

Creating a new command is simple, create a new file in the commands folder calling it whatever you want the command to be called, for example ping.js
Add the following code to the new command file. In every command file you will always need to use this format. (message.channel.send('pong!') is not reqired, just an example).

const discord = require ("discord.js");

exports.run = (client, message, args) =>{
    message.channel.send ('pong!')
}

Further documentation can be found here or you can read my Blog Post which will explain how to create a Basic Discord BOT here

Contribute

If you would like to contribute to the project please open a PR (Pull Request) clearly showing your changes.

Issues

If you have any issues feel free to open an issue or join the Discord Server

Extra

Created by LachlanDev#8014

About

A template used to start developing a Discord BOT in Node.JS.

https://lachlan-dev.com

License:MIT License


Languages

Language:JavaScript 100.0%