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.");