From 71ff30ea87c7e41d7836281d974e1b7ca69e73f5 Mon Sep 17 00:00:00 2001 From: Vermium Sifell Date: Mon, 24 Oct 2022 10:09:58 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A8=20JS-0116=20JS-0376?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/helpers/credits/set.ts | 2 +- src/helpers/credits/take.ts | 2 +- src/helpers/credits/transactionRules.ts | 2 +- src/helpers/credits/transfer.ts | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/helpers/credits/set.ts b/src/helpers/credits/set.ts index 2db8cf7..c8053e0 100644 --- a/src/helpers/credits/set.ts +++ b/src/helpers/credits/set.ts @@ -5,7 +5,7 @@ import transactionRules from "./transactionRules"; export default async (guild: Guild, user: User, amount: number) => { return await prisma.$transaction(async (tx) => { // 1. Check if the transaction is valid. - await transactionRules(guild, user, amount); + transactionRules(guild, user, amount); // 2. Make the transaction. const recipient = await tx.guildMember.upsert({ diff --git a/src/helpers/credits/take.ts b/src/helpers/credits/take.ts index ae21ed6..7b97e2b 100644 --- a/src/helpers/credits/take.ts +++ b/src/helpers/credits/take.ts @@ -5,7 +5,7 @@ import transactionRules from "./transactionRules"; export default async (guild: Guild, user: User, amount: number) => { return await prisma.$transaction(async (tx) => { // 1. Check if the transaction is valid. - await transactionRules(guild, user, amount); + transactionRules(guild, user, amount); // 2. Make the transaction. const recipient = await tx.guildMember.upsert({ diff --git a/src/helpers/credits/transactionRules.ts b/src/helpers/credits/transactionRules.ts index 021448f..ea9d7b1 100644 --- a/src/helpers/credits/transactionRules.ts +++ b/src/helpers/credits/transactionRules.ts @@ -1,6 +1,6 @@ import { Guild, User } from "discord.js"; -export default async (guild: Guild, user: User, amount: number) => { +export default (guild: Guild, user: User, amount: number) => { // 1. Verify that the amount is not above 100.000.000 credits. if (amount > 100000000) { throw new Error("You can't give more than 1.000.000 credits."); diff --git a/src/helpers/credits/transfer.ts b/src/helpers/credits/transfer.ts index 7177328..c85518e 100644 --- a/src/helpers/credits/transfer.ts +++ b/src/helpers/credits/transfer.ts @@ -48,8 +48,8 @@ export default async (guild: Guild, from: User, to: User, amount: number) => { } // 5. Check if the transactions is valid. - await transactionRules(guild, from, amount); - await transactionRules(guild, to, amount); + transactionRules(guild, from, amount); + transactionRules(guild, to, amount); // 6. Verify that sender and recipient are not the same user. if (from.id === to.id) throw new Error("You can't transfer to yourself.");