rootbot-roits-transfer
v1.0.0
Published
A Discord bot utility to track RootBot Roits transfers.
Maintainers
Readme
TransferCheck
A simple utility for discord.js that waits for a successful RootBot transfer message and returns whether the transfer was completed.
Features
- ✅ Supports Arabic & English transfer messages.
- ✅ Detects the transferred amount.
- ✅ Matches the receiver automatically using their Discord ID.
- ✅ Promise-based API.
- ✅ Configurable timeout.
Installation
const TransferCheck = require("rootbot-roits-transfer");Usage
const success = await TransferCheck({
botId: "ROOT_BOT_ID",
userId: "targetUser ID",
amount: 10,
timeout: 60000,
channel: message.channel,
});
if (success) {
console.log("Transfer completed.");
} else {
console.log("Transfer failed or timed out.");
}Options
| Option | Type | Description |
|---------|------|-------------|
| botId | string | RootBot's ID. |
| userId | string | Receiver's Discord ID. |
| amount | number \| string | Expected transfer amount. |
| timeout | number | Waiting time in milliseconds. |
| channel | TextBasedChannel | The channel where the transfer is expected. |
Return Value
Returns a Promise<boolean>.
| Value | Description |
|-------|-------------|
| true | Transfer message detected. |
| false | Transfer was not detected before timeout. |
Example
message.channel.send(`r <@${target.id}> 10`);
const success = await TransferCheck({
botId: process.env.ROOTBOT_ID,
userId: target.id,
amount: 10,
timeout: 60000,
channel: message.channel,
});
if (!success) {
return message.reply("Transfer not detected.");
}
message.reply("Payment received successfully.");Notes
- The collector only accepts messages sent by the specified
botId. - Supports both Arabic (
قام بتحويل) and English (transferred) transfer messages. - Automatically resolves the receiver's username from the provided Discord ID.
