bulut-verification-probot
v1.0.4
Published
Secure transaction verification utility.
Readme
Bulut Verification
A professional, high-precision utility for validating financial transactions within Discord. Designed to handle concurrency, strict type enforcement, and automated tax calculations with regex-based precision.
Features
Atomic Verification: Prevents race conditions by validating buyer identity and recipient IDs simultaneously.
Strict RegEx Matching: Validates exact amounts, ignoring formatting variances (e.g., $1,000 vs 1000).
Auto-Tax Calculation: Built-in logic for tax computation (ceil precision).
Crash Resistant: Internal error suppression ensures main process stability.
Installation code Bash download content_copy expand_less npm install bulut-verification-probot Implementation Examples
- Basic Usage
The following example demonstrates a standard transaction flow: calculating tax, prompting the user, and awaiting verification.
code JavaScript download content_copy expand_less const BulutVerify = require('bulut-verification-probot'); const { Client, GatewayIntentBits } = require('discord.js');
const client = new Client({ intents: [ GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages, GatewayIntentBits.MessageContent ] });
// Initialize with default settings (Official ProBot ID, 5% Tax) const paymentGate = new BulutVerify();
client.on('messageCreate', async (message) => { if (message.content.startsWith('!buy')) { const netPrice = 10000; // The amount you want to receive const merchantId = 'YOUR_WALLET_ID';
// Step 1: Calculate the gross amount (Amount + Tax)
const grossAmount = paymentGate.calculate(netPrice);
await message.reply(`Please transfer: **${grossAmount}** (Net: ${netPrice})`);
// Step 2: Await the transaction message
// The library automatically handles regex matching and validation
const transaction = await paymentGate.awaitTransaction(
message.channel, // Channel to monitor
message.author, // The buyer (User Object)
merchantId, // The recipient ID
netPrice // Important: Pass the NET amount expected
);
// Step 3: Handle the result
if (transaction.status) {
console.log(`[Audit] Transaction verified at ${transaction.timestamp}`);
await message.reply('✅ Payment Verified Successfully.');
} else {
await message.reply('❌ Transaction timed out or validation failed.');
}
}});
client.login('YOUR_TOKEN'); 2. Advanced Configuration
You can customize the tax rate, timeout duration, or the bot ID if you are using a premium instance.
code JavaScript download content_copy expand_less const BulutVerify = require('bulut-verification-probot');
// Custom Configuration const verifier = new BulutVerify({ probotId: '123456789...', // Custom Premium Bot ID taxRate: 0.95, // Tax Rate (Default: 0.95) defaultTimeout: 120000 // Wait time: 2 Minutes (Default: 60s) });
// Usage remains the same const tax = verifier.calculate(5000); API Reference calculate(amount: number): number
Returns the gross amount required to receive the specified net value.
amount: The net value expected.
awaitTransaction(channel, buyer, recipientId, amount, timeout?): Promise
Starts a listener for a verification message.
Parameter Type Description channel TextChannel The channel where the transaction occurs. buyer User The user object initiating the payment. recipientId string The ID receiving the credits. amount number The expected net amount. timeout number (Optional) Timeout in milliseconds.
Return Object:
code JavaScript download content_copy expand_less { status: boolean, // true if verified, false if timeout timestamp: number, // Timestamp of the ProBot message message: Message // The original Discord Message object } License
Distributed under the MIT License.
Maintained by Rico Host Dev Team
