Commando is the official framework for discord.js. To make connected your Faunadb to your bot a bit easier I "remade" the sqliteProvider from the framework to use FaunaDB.
This installs the faunadb package and this package.
# With NPM
npm install --save faunadb commando-provider-faundb
Below is an example on how to use it with faunadb (recommended).
Creating a new provider will create a new collection called guilds
in your database and also create a new index guild_by_id
.
- The collection is to store all the data.
- The index is so that we can query based on the guilds id do not have to store the id given by FaunaDB.
const { Client } = require('faunadb');
const FaunaProvider = require('commando-provider-faunadb');
...
client.setProvider(
new FaunaProvider(new Client({ secret: '<you-secret-database-key>' }))
);
...
MIT © XanderD99