Skip to content

Commit

Permalink
bug with naming
Browse files Browse the repository at this point in the history
  • Loading branch information
XanderD99 committed Nov 2, 2020
1 parent 0c94a49 commit 6da95ab
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
5 changes: 3 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const {
Lambda,
Documents,
Collection: FaunaCollection,
Map,
Map: FaunaMap,
Paginate,
CreateIndex,
Exists,
Expand Down Expand Up @@ -40,14 +40,15 @@ module.exports = class FaunaProvider extends SettingProvider {
}

// this could take a while if it is a big collection
const guilds = (await this.db.query(Map(
const guilds = (await this.db.query(FaunaMap(
Paginate(Documents(FaunaCollection('guilds'))),
Lambda((x) => Get(x)),
))).data;

guilds.forEach(({ data }) => {
const guild = data.id !== '0' ? data.id : 'global';
const settings = data;
console.log(guild, settings)
this.settings.set(guild, settings);
if (guild !== 'global' && !client.guilds.cache.has(guild)) return;
this.setupGuild(guild, settings);
Expand Down
5 changes: 5 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
},
"homepage": "https://gitlab.com/npm7/commando-provider-faunadb#readme",
"peerDependencies": {
"discord.js-commando": "^0.9.0",
"mongodb": "^3.0"
"discord.js-commando": "^0.10.0",
"faunadb": "^3.0.1"
}
}

0 comments on commit 6da95ab

Please sign in to comment.