Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lwzff/discord-bot-template-v14
Simple, stable, working, efficient, Discord bot template for Discord.JS V14
https://github.com/lwzff/discord-bot-template-v14
discord discord-bot discord-js discordbot discordjs discordjs-bot discordjs-v14 discordjsbot djs djs-v14 djsbot djsv14
Last synced: 4 months ago
JSON representation
Simple, stable, working, efficient, Discord bot template for Discord.JS V14
- Host: GitHub
- URL: https://github.com/lwzff/discord-bot-template-v14
- Owner: lwzff
- License: gpl-3.0
- Created: 2023-01-17T10:48:19.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-30T00:10:12.000Z (5 months ago)
- Last Synced: 2024-09-29T08:42:42.572Z (4 months ago)
- Topics: discord, discord-bot, discord-js, discordbot, discordjs, discordjs-bot, discordjs-v14, discordjsbot, djs, djs-v14, djsbot, djsv14
- Language: JavaScript
- Homepage:
- Size: 36.1 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Discord Bot Template (DJS v14)
This repository includes my personal bot template (all the base that I own and I am using for my current bots).
## Need help ?
[Try out the documentation!](https://github.com/lwzff/discord-bot-template-v14?tab=readme-ov-file#documentation)## Installation
1. Clone this project and/or download the ZIP file.
2. Get your [Discord Bot Token](https://discord.com/developers/applications) and then copy/paste it into the **.env** file.
3. Get your [MongoDB Database URL](https://cloud.mongodb.com/) 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:
```bash
npm i
```**Dependencies (in case of any problems):**
- discord.js
- mongoose
- term-logger
- fs
- dotenv## Documentation
Work in progress..
### Mongoose (MongoDB) Model/Schema Example
1. Create your model in **/models/** as **MyModel.js**.
2. Put the code below in this file and edit it like you want.```js
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).
```js
const { MyModelName } = require('../../models/MyModel');
```### Function Example
1. Create your function in **/functions/** as **MyFunction.js**.
2. Put the code below in this file and edit it like you want.
```js
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).
```js
const { functionName } = require('../../functions/MyFunction');
```## Authors
- [@lwzff](https://www.twitter.com/lwzff)