This repository includes my personal bot template (all the base that I own and I am using for my current bots).
-
Clone this project and/or download the ZIP file.
-
Get your Discord Bot Token and then copy/paste it into the .env file.
-
Get your MongoDB Database URL and then copy/paste it into the .env file.
Note: If you don't have any MongoDB Database, leave it blank.
After that, install all dependencies with npm:
npm i
Dependencies (in case of any problems):
- discord.js
- mongoose
- term-logger
- fs
- dotenv
Work in progress..
- Create your model in /models/ as MyModel.js.
- Put the code below in this file and edit it like you want.
const mongoose = require("mongoose");
module.exports = mongoose.model(
"MyModelName",
new mongoose.Schema({
property1: { type: String, required: true, unique: true },
})
);
How to use this model ?
Put at the top-level of your command file or event file this (based on your model).
const { MyModelName } = require('../../models/MyModel');
- Create your function in /functions/ as MyFunction.js.
- Put the code below in this file and edit it like you want.
module.exports.functionName = (arg1) => {
console.log(arg1)
return arg1
}
How to use this function ?
Put at the top-level of your command file or event file this (based on your function).
const { functionName } = require('../../functions/MyFunction');