From 7d7560571036594d20db7a5328f041f97cab380e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20DEM=C4=B0RC=C4=B0?= Date: Thu, 21 Jan 2021 07:06:30 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=8F=86=20Update=20version?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/index.ts | 26 ++++++++++++++------------ 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/package.json b/package.json index e0af6d3..1fc13f4 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/index.ts b/src/index.ts index 0f20a05..32c7817 100644 --- a/src/index.ts +++ b/src/index.ts @@ -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); } @@ -92,7 +94,7 @@ export class ReactionRole extends Client { } public async exportConfig(): Promise { - const data = (await this.database.fetchAll()) as unknown as IConfig; + const data = ((await this.database.fetchAll()) as unknown) as IConfig; return data; } @@ -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;