Skip to main content
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:
/checkuser <id|username>

Usage Examples

/checkuser 123456789

Response Format

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

Information Displayed

1

User Identification

  • Telegram User ID (numeric)
  • Display Name
  • Username (if available)
  • Email address (from payment)
2

Subscription Status

  • Active or Inactive
  • Current plan type (Basic, Bi-Weekly, Monthly, Premium)
  • Expiration date
  • Days remaining
3

MT5 Copier Status

  • Setup completion status
  • Copier active/inactive
  • Account configuration
4

Payment History

  • Total number of subscriptions purchased
  • Total amount spent (lifetime value)
  • Historical plan types

Common Use Cases

Handle Support Requests

  1. Run /checkuser <username> to verify subscription
  2. Check if subscription is active and not expired
  3. If active, check inviteLinkUsed field
  4. Generate new invite link if needed
  5. Verify user hasn’t been banned from channel
Common causes:
  • Expired subscription
  • User was removed for violation
  • Invite link expired (24 hours)
  1. Ask user for payment reference
  2. Run /checkuser <username>
  3. Check payment history for matching transaction
  4. 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
  1. Run /checkuser <username> to see MT5 setup status
  2. Check setupStatus field:
    • pending - Setup not completed
    • active - Working correctly
    • error - Setup failed
  3. Review statusMessage for error details
  4. 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

1

User Starts Bot

User clicks /start → Added to User table
2

Makes Payment

Completes payment → Subscription record created
3

Verification

Runs /verify_<plan> REFERENCE → Access granted
4

Channel Access

Receives invite link → Joins VIP channel
5

Premium Setup (if applicable)

Runs /mt5setup → Copier configured

Renewal Flow

1

Expiry Approaching

User subscription nearing expiration (check daily)
2

Reminder (Optional)

Send broadcast: ”⏰ Your subscription expires in 2 days!”
3

User Renews

Makes new payment → Runs verification
4

Stacked Expiry

New expiration = current expiry + plan duration (if still active)

Expiry Handling

1

Subscription Expires

expiresAt < current date
2

Automatic Removal

Cron job checks expired subscriptions daily
3

Channel Access Revoked

User removed from VIP channel
4

MT5 Copier Disabled

Copier settings remain but inactive
5

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

Build docs developers (and LLMs) love