CoinSnitch is a powerful TypeScript library for detecting virtual currency transfers in Discord. Monitor NovaGolds, LutexBits, Credits, and more with type-safe, real-time detection.
Features โข Installation โข Quick Start โข Documentation โข Support
- ๐ท Full TypeScript Support โ Complete type definitions and IntelliSense
- ๐ฑ Multi-Currency Detection โ NovaGolds, LutexBits, Credits, and extensible for more
- โก Real-time Monitoring โ Instant detection via
messageCreateandmessageUpdateevents - ๐ฏ Flexible Amount Matching โ Support for single or multiple amounts
- ๐ก๏ธ Type-Safe โ Catch errors at compile time, not runtime
- ๐ Easy Integration โ Works seamlessly with Discord.js v13 & v14
- ๐งฉ Modular Architecture โ Import only what you need
- โ๏ธ Highly Configurable โ Customizable timeouts and filters
- ๐ฆ Zero Dependencies โ Lightweight and efficient (only peer dependencies)
npm install coinsnitchyarn add coinsnitchpnpm add coinsnitch- Node.js 16.x or higher
- Discord.js v13 or v14
- TypeScript 4.7+ (for TypeScript projects)
import { Client, TextChannel } from 'discord.js';
import { watchNovaGolds } from 'coinsnitch';
const client = new Client({ intents: ['Guilds', 'GuildMessages'] });
client.on('messageCreate', async (message) => {
if (message.content === '!transfer') {
const result = await watchNovaGolds({
channel: message.channel as TextChannel,
botId: '123456789',
userId: message.author.id,
amount: [10, 50, 100],
timeout: 60000
});
if (result) {
message.reply(`โ
Transfer detected: $${result.amount}`);
} else {
message.reply('โ No transfer detected within timeout');
}
}
});
client.login('YOUR_BOT_TOKEN');const { Client } = require('discord.js');
const { watchCredits } = require('coinsnitch');
const client = new Client({ intents: ['Guilds', 'GuildMessages'] });
client.on('messageCreate', async (message) => {
const result = await watchCredits({
channel: message.channel,
botId: '987654321',
userId: message.author.id,
amount: 25,
timeout: 30000
});
if (result) {
console.log(`Transfer confirmed: $${result.amount}`);
}
});
client.login('YOUR_BOT_TOKEN');Monitors NovaGolds currency transfers via messageCreate events.
Options:
interface NovaGoldsWatchOptions {
channel: TextChannel; // Discord channel to monitor
botId: string; // Bot ID that sends transfer confirmations
userId: string; // User ID receiving the transfer
amount: number | number[]; // Amount(s) to detect
timeout?: number; // Max wait time in ms (default: 60000)
}Returns:
Promise<WatchResult | false>
interface WatchResult {
message: Message; // The matched Discord message
amount: number; // The exact amount that was matched
}Example:
const result = await watchNovaGolds({
channel: textChannel,
botId: '123456789',
userId: '987654321',
amount: [5, 10, 20],
timeout: 60000
});
if (result) {
console.log(`Received ${result.amount} NovaGolds`);
console.log(`Message ID: ${result.message.id}`);
}Monitors Credits currency transfers via messageCreate events.
Options:
interface CreditsWatchOptions {
channel: TextChannel;
botId: string;
userId: string;
amount: number | number[];
timeout?: number;
}Returns: Promise<WatchResult | false>
Example:
const result = await watchCredits({
channel: message.channel as TextChannel,
botId: '555666777',
userId: targetUser.id,
amount: 100
});Monitors LutexBits currency transfers via messageUpdate events (for edited messages).
Options:
interface LutexBitsWatchOptions {
channel: TextChannel;
client: Client; // Discord.js client instance
userId: string;
amount: number | number[];
timeout?: number;
}Returns: Promise<WatchResult | false>
Example:
const result = await watchLutexBits({
channel: message.channel as TextChannel,
client: client,
userId: '111222333',
amount: [1, 5, 10, 50]
});
if (result) {
await message.reply(`LutexBits transfer successful: $${result.amount}`);
}// Detect any of these amounts
const result = await watchNovaGolds({
channel: channel,
botId: botId,
userId: userId,
amount: [10, 25, 50, 100, 500]
});
// Returns the actual amount matched
if (result) {
switch(result.amount) {
case 10:
console.log('Small transfer detected');
break;
case 100:
console.log('Medium transfer detected');
break;
case 500:
console.log('Large transfer detected!');
break;
}
}const result = await watchCredits({
channel: channel,
botId: botId,
userId: userId,
amount: 50,
timeout: 30000 // 30 seconds
});
if (!result) {
console.log('Transfer not detected within 30 seconds');
// Handle timeout logic here
}// Watch multiple currencies simultaneously
const [novaResult, creditsResult, lutexResult] = await Promise.all([
watchNovaGolds({ channel, botId, userId, amount: 10 }),
watchCredits({ channel, botId, userId, amount: 10 }),
watchLutexBits({ channel, client, userId, amount: 10 })
]);
const successful = [novaResult, creditsResult, lutexResult]
.filter(Boolean)
.map(r => r!.amount);
console.log(`Detected transfers: ${successful.join(', ')}`);coinsnitch/
โโโ src/
โ โโโ filters/
โ โ โโโ creditsFilter.ts
โ โ โโโ lutexBitsFilter.ts
โ โ โโโ novaGoldsFilter.ts
โ โโโ utils/
โ โ โโโ createMessageWatcher.ts
โ โโโ watchers/
โ โ โโโ watchCredits.ts
โ โ โโโ watchLutexBits.ts
โ โ โโโ watchNovaGolds.ts
โ โโโ index.ts
โ โโโ index.d.ts
โโโ dist/ # Compiled JavaScript
โโโ tsconfig.json
โโโ package.json
โโโ README.md
โโโ LICENSE
- ๐ฎ Economy Bots โ Track in-game currency transactions
- ๐ฐ Gambling Systems โ Verify bet payments and payouts
- ๐ช Shop Bots โ Confirm purchase transactions
- ๐ Giveaway Bots โ Validate prize distributions
- ๐ Transaction Logging โ Monitor and record all transfers
- ๐ Payment Verification โ Ensure secure currency exchanges
| Currency | Watcher Function | Event Type |
|---|---|---|
| ๐ฐ Credits | watchCredits() |
messageCreate |
| ๐ NovaGolds | watchNovaGolds() |
messageCreate |
| ๐ง LutexBits | watchLutexBits() |
messageUpdate |
CoinSnitch is designed to be extensible. You can create custom filters and watchers for any currency format.
- LutexBits uses
messageUpdateevents (requiresMESSAGE_CONTENTintent) - NovaGolds and Credits use
messageCreateevents - Always ensure your bot has the necessary Discord intents enabled
- Timeouts default to 60 seconds but can be customized
- The library returns
falseon timeout or no match
If you're using TypeScript, ensure your tsconfig.json includes:
{
"compilerOptions": {
"esModuleInterop": true,
"moduleResolution": "node",
"resolveJsonModule": true,
"lib": ["ES2021"]
}
}Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Need help? Have questions?
- ๐ฌ Join our Discord Server
- ๐ Report Issues
- ๐ง Contact: support@example.com
This project is licensed under the Apache License 2.0 โ see the LICENSE file for details.
- Built with โค๏ธ for the Discord.js community
- Special thanks to all contributors and testers
- Powered by TypeScript for enhanced developer experience
Made with โค๏ธ by the Nexus Studio Team
