Skip to content

A MongoDB provider for Commando (Stable for djs 12.2.x)

License

Notifications You must be signed in to change notification settings

Aizuu-fork/commando-provider-mongo

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Commando MongoDBProvider

Downloads Version Dependency status

MongoDB provider for Commando

About

Commando is the official framework for discord.js, I like how easy it is to get started with it and add own commands, types, etc. Recently I started working on a bot that required to be connected to MongoDB. I converted the default SQLLiteProvider into a provider that could use MongoDB as storage.

Installation

If you want to use [email protected], use [email protected]!

# With Yarn (recommended)
yarn add mongodb commando-provider-mongo

# With NPM
npm install --save mongodb commando-provider-mongo

Usage

Below is an example on how to use it with node-mongodb-native (recommended). There are probably other mongodb clients whose are able to return a Db instance of MongoClient and you are free to use them. However I will not deliver any support if you use another client.

const MongoClient = require('mongodb').MongoClient;
const MongoDBProvider = require('commando-provider-mongo');

...

client.setProvider(
	MongoClient.connect('mongodb://localhost:27017').then(client => new MongoDBProvider(client, 'abot'))
).catch(console.error);

...

License

MIT © Paul Hobbel

About

A MongoDB provider for Commando (Stable for djs 12.2.x)

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%