xyter/dist/helpers/credits/transactionRules.js
semantic-release-bot 3df4c05c5d chore(release): 1.3.3 [skip ci]
## [1.3.3](https://github.com/ZynerOrg/xyter/compare/v1.3.2...v1.3.3) (2022-12-13)

### Bug Fixes

* add custom semrel git ([c07befe](c07befe678))
2022-12-13 16:58:44 +00:00

16 lines
573 B
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = (guild, user, amount) => {
// 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.");
}
// 2. Verify that the amount is not below 1 credits.
if (amount <= 0) {
throw new Error("You can't give below one credit.");
}
// 3. Verify that the user is not an bot.
if (user.bot) {
throw new Error("You can't give to an bot.");
}
};