Skip to content
This repository has been archived by the owner on Nov 12, 2020. It is now read-only.

feat: add economy and tax settings #37

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open

feat: add economy and tax settings #37

wants to merge 12 commits into from

Conversation

Quantumlyy
Copy link
Contributor

No description provided.

@Quantumlyy Quantumlyy added the Status: WIP Issues and PRs that are still a work in progress. label Sep 14, 2020
@Quantumlyy Quantumlyy linked an issue Sep 14, 2020 that may be closed by this pull request
Comment on lines +1 to +25
import { AsyncQueue } from "@klasa/async-queue";
import { DbSet } from "@lib/structures/DbSet";
import { singleton } from "tsyringe";

@singleton()
export class TaxationManager {

public queue: AsyncQueue = new AsyncQueue();

public async tax(amount: bigint) {
await this.queue.wait();

try {
const connection = await DbSet.connect();
const settings = await connection.clients.ensureEconomy();

settings.economy.quantumsMoneyPile += amount;

await settings.save();
} finally {
this.queue.shift();
}
}

}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This apparently locks everything.

Well been a while but lets continue
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Status: WIP Issues and PRs that are still a work in progress.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

todo: profiles and social features
1 participant