The admin panel provides powerful tools to look up users, check subscription status, and manage access to your Telegram bot.
Check User Command
Look up any user by their Telegram ID or username:
Usage Examples
When you run /checkuser, you’ll receive a detailed report:
👤 User Lookup: @username
━━━━━━━━━━━━━━━━━━━
🆔 ID: 123456789
👤 Name: John Doe
📧 Email: [email protected]
━━━━━━━━━━━━━━━━━━━
📊 Subscription:
• Status: ✅ ACTIVE
• Plan: PREMIUM
• Expires: 12/31/2024
🤖 MT5 Copier:
• Setup: ✅ CONFIGURED
• Status: ACTIVE
━━━━━━━━━━━━━━━━━━━
💳 History:
• Total Subs: 3
• Total Spent: ₦52,000
User Identification
- Telegram User ID (numeric)
- Display Name
- Username (if available)
- Email address (from payment)
Subscription Status
- Active or Inactive
- Current plan type (Basic, Bi-Weekly, Monthly, Premium)
- Expiration date
- Days remaining
MT5 Copier Status
- Setup completion status
- Copier active/inactive
- Account configuration
Payment History
- Total number of subscriptions purchased
- Total amount spent (lifetime value)
- Historical plan types
Common Use Cases
Handle Support Requests
User Can't Access Channel
- Run
/checkuser <username> to verify subscription
- Check if subscription is active and not expired
- If active, check
inviteLinkUsed field
- Generate new invite link if needed
- Verify user hasn’t been banned from channel
Common causes:
- Expired subscription
- User was removed for violation
- Invite link expired (24 hours)
Payment Verification Issues
- Ask user for payment reference
- Run
/checkuser <username>
- Check payment history for matching transaction
- If payment found but subscription inactive:
- Check expiration date
- Verify
isRemoved status
- Check for duplicate references
Resolution:# If legitimate issue, manually extend in database
# or ask user to use /verify_<plan> again
- Run
/checkuser <username> to see MT5 setup status
- Check
setupStatus field:
pending - Setup not completed
active - Working correctly
error - Setup failed
- Review
statusMessage for error details
- Guide user through
/mt5setup again if needed
Common issues:
- Wrong account type (not Cent account)
- Incorrect password
- Wrong server (not headway-real)
Monitor High-Value Users
# Check a user who has made multiple purchases
/checkuser @frequentbuyer
Use this to:
- Identify VIP customers
- Offer personalized support
- Track lifetime value
- Send targeted retention offers
Users with 3+ subscriptions are 5x more likely to continue renewing. Prioritize their support requests.
Investigate Abuse or Fraud
/checkuser @suspicious_user
Check for:
- Multiple accounts using same payment method
- Unusual subscription patterns
- Promo code abuse
- Refund requests with active subscriptions
If you find abuse, use the database to set isRemoved: true and revoke channel access.
Database Schema Reference
Understanding the data structure helps with advanced user management:
User Table
model User {
id String @id
telegramUserId String @unique
telegramUsername String?
telegramName String?
createdAt DateTime
updatedAt DateTime
}
Key Fields:
telegramUserId - Unique Telegram ID (searchable)
telegramUsername - Can change, may be null
- Tracks all users who ever interacted with bot
Subscription Table
model Subscription {
id String @id
telegramUserId String
paystackRef String // Payment reference
planType String
hasCopierAccess Boolean
startedAt DateTime
expiresAt DateTime
isRemoved Boolean // Access revoked
inviteLinkUsed String?
mt5Setup Mt5Setup?
}
Key Fields:
expiresAt - Check against current date for active status
isRemoved - Manual revocation flag
hasCopierAccess - Premium plan indicator
paystackRef - Unique payment identifier
MT5 Setup Table
model Mt5Setup {
id String
subscriptionId String @unique
loginAccountNumber String
setupStatus String // pending, active, error
statusMessage String?
copierMultiplier Float
maxLotSize Float
maxOpenPositions Int
}
Key Fields:
setupStatus - Current copier state
statusMessage - Error details for troubleshooting
- Copier settings stored per user
Manual Database Operations
For advanced user management, you can directly query the database.
Caution: Direct database modifications bypass application logic. Always test queries on staging first.
Find User by Email
const user = await prisma.subscription.findFirst({
where: {
customerEmail: {
equals: '[email protected]',
mode: 'insensitive'
}
},
include: { mt5Setup: true }
})
Extend User Subscription
// Add 7 days to expiration
const extended = await prisma.subscription.update({
where: { id: subscriptionId },
data: {
expiresAt: new Date(Date.now() + 7 * 24 * 60 * 60 * 1000)
}
})
Revoke User Access
await prisma.subscription.update({
where: { id: subscriptionId },
data: {
isRemoved: true,
removedAt: new Date()
}
})
// Then ban from channel
await unbanChatMember(channelId, userId)
Find All Users of a Plan
const premiumUsers = await prisma.subscription.findMany({
where: {
planType: 'premium',
expiresAt: { gt: new Date() },
isRemoved: false
},
orderBy: { expiresAt: 'asc' }
})
User Lifecycle Management
New User Flow
User Starts Bot
User clicks /start → Added to User table
Makes Payment
Completes payment → Subscription record created
Verification
Runs /verify_<plan> REFERENCE → Access granted
Channel Access
Receives invite link → Joins VIP channel
Premium Setup (if applicable)
Runs /mt5setup → Copier configured
Renewal Flow
Expiry Approaching
User subscription nearing expiration (check daily)
Reminder (Optional)
Send broadcast: ”⏰ Your subscription expires in 2 days!”
User Renews
Makes new payment → Runs verification
Stacked Expiry
New expiration = current expiry + plan duration (if still active)
Expiry Handling
Subscription Expires
expiresAt < current date
Automatic Removal
Cron job checks expired subscriptions daily
Channel Access Revoked
User removed from VIP channel
MT5 Copier Disabled
Copier settings remain but inactive
Data Retained
User history preserved for re-activation
Bulk Operations
Export User List
Get all active subscribers for analysis:
const activeUsers = await prisma.subscription.findMany({
where: {
expiresAt: { gt: new Date() },
isRemoved: false
},
select: {
telegramUsername: true,
telegramName: true,
customerEmail: true,
planType: true,
expiresAt: true
}
})
// Export as CSV
const csv = activeUsers.map(u =>
`${u.telegramUsername},${u.telegramName},${u.customerEmail},${u.planType},${u.expiresAt}`
).join('\n')
Find Users to Re-engage
const churned = await prisma.subscription.findMany({
where: {
expiresAt: {
// Expired 1-7 days ago
gte: new Date(Date.now() - 7 * 24 * 60 * 60 * 1000),
lt: new Date()
},
isRemoved: false
}
})
// Send win-back offer to these users