Skip to content

LachlanDev/Discord-BOT-Template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation



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