Skip to content

RonaldZav/discordbot-base

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Documentation

Setup:

Clone the repository in your device:

git clone https://github.com/RonaldZav/discordbot-base.git

Configuration:

Install dependencies with npm install

Set the credentials of your discord bot in .env.example

Rename .env.example to .env

Start using node src/index.js

MongoDB Manager:

Main function to manage the MongoDB database:

await client.database(query, collection) // => Create/found mongodb documents.

Usage example:

// Get/create the database
let db = await client.database({ guild: interaction.guild.id }, "guilds") || {};

// Set the data
db.config = { prefix: "!" }; // => { config: { "prefix": "!" } };

// Save changes
await db.save();

// Reload information into the variable if necessary
await db.reload();

About

Discord bot base with slashCommand handler

Resources

License

Stars

Watchers

Forks

Packages

No packages published