1.5.0 • Published 3 years ago

@botsmk2/mongodb v1.5.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

@botsmk2/mongodb

npm

A custom class for managing the connection to MongoDB and for storing Discord bot information.

Install

$ npm install @botsmk2/mongodb

Usage

const {MongoDB, Bot} = require('@botsmk2/mongodb');
const mongoDB = new MongoDB(true); //true if the project accessing MongoDB is a bot && process.env.BOT_DATABASE has been set
//=> Opened connection to database
//=> Opened conection to bot's database
const {MongoDB, Bot} = require('@botsmk2/mongodb');
const mongodb = new MongoDB(false);
mongodb.on('databaseConnected', function() {
  const bot = new Bot();
  bot.name = "TEMPORARY BOT";
  bot.description = "This bot is just a test";
  bot.owner = {email: 'useremail@gmail.com', discordID: '1234567890987654321'};
  bot.productionStatus = 'pending';
  bot.addStatus('YouTube', 'watching');
  bot.addVariable('PREFIX', '!');
  bot.addVariable('BOT_TOKEN', 'NULL');
  bot.addVariable('CLIENT_ID', 'NULL');
  bot.addVariable('CLIENT_SECRET', 'NULL');
  bot.addVariable('TZ', 'America/Indiana/Indianapolis');

  bot.saveToDatabase(mongodb.db);
})
1.5.0

3 years ago

1.4.0

4 years ago

1.3.1

4 years ago

1.2.0

4 years ago

1.3.0

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago