Skip to content

Commit

Permalink
🏆 Update version
Browse files Browse the repository at this point in the history
  • Loading branch information
barbarbar338 authored Jan 21, 2021
1 parent 1aa701e commit 7d75605
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
},
"main": "dist",
"name": "reaction-role",
"version": "3.2.2",
"version": "3.2.3",
"description": "ReactionRole is a module that allows you to create Discord reaction role easily!",
"scripts": {
"prebuild": "rimraf dist",
Expand Down
26 changes: 14 additions & 12 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,17 @@ export class ReactionRole extends Client {
super();
this._token = token;
let adapter;
if (mongodb_uri) adapter = new adapters.MongoDB({
databaseName: "RR",
defaultDir: "ReactionRole",
mongodbURL: mongodb_uri
});
else adapter = new adapters.FS({
databaseName: "RR",
defaultDir: "ReactionRole"
});
if (mongodb_uri)
adapter = new adapters.MongoDB({
databaseName: "RR",
defaultDir: "ReactionRole",
mongodbURL: mongodb_uri,
});
else
adapter = new adapters.FS({
databaseName: "RR",
defaultDir: "ReactionRole",
});
this.database = new Database(adapter);
}

Expand Down Expand Up @@ -92,7 +94,7 @@ export class ReactionRole extends Client {
}

public async exportConfig(): Promise<IConfig> {
const data = (await this.database.fetchAll()) as unknown as IConfig;
const data = ((await this.database.fetchAll()) as unknown) as IConfig;
return data;
}

Expand Down Expand Up @@ -164,9 +166,9 @@ export class ReactionRole extends Client {
packet.t != "MESSAGE_REACTION_REMOVE")
)
return;
const messageData = await this.database.get(
const messageData = (await this.database.get(
packet.d.message_id,
) as IMessageData;
)) as IMessageData;
if (!messageData) return;
const guild = this.guilds.cache.get(packet.d.guild_id);
if (!guild) return;
Expand Down

0 comments on commit 7d75605

Please sign in to comment.