CREATORS/OnecreatorsbotPublic · Bot Template

ProfileTelegram

AIThe bot manages a membership club called CREATORS. Users can apply for membership, view their status, and receive payment instructions. Administrators can approve or reject applications, set subscription prices, configure payment details, and review pending payments. The bot stores data in a database, sends notifications to users and admins, and handles payment receipts via photo or document uploads.

Commercemembershipsubscriptionpaymentsadmincreatortelegram
22 commands1 envUpdated 20d agoCreated Oct 6, 2026
Back to folder

commands/_checkpayments.js

javascript · 78 lines

Raw
1/**#command2name: /checkpayments3answer: 4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12 13const adminId = String(process.env.ADMIN_ID);14 15if (String(user.id) !== adminId) {16  await Api.sendMessage({17    chat_id: chat.id,18    text: "⛔️ این دستور فقط برای مدیر است."19  });20  return;21}22 23const targetUserId = 1747493585;24 25// بررسی رسید ذخیره‌شده برای کاربر26const pendingReceipt = await db.user.get(27  "pending_payment_receipt",28  null,29  { user_id: targetUserId }30);31 32// خواندن آرشیو پرداخت‌های تأییدشده33const archive = await db.bot.get(34  "creators_confirmed_payments",35  []36);37 38const payments = Array.isArray(archive) ? archive : [];39 40const userPayments = payments.filter(41  item => Number(item.user_id) === targetUserId42);43 44const lines = [45  "🔎 گزارش بررسی آرشیو پرداخت",46  "━━━━━━━━━━━━━━━━━━",47  "",48  "🆔 شناسه کاربر: " + targetUserId,49  "",50  "📥 رسید در انتظار:",51  pendingReceipt && pendingReceipt.receipt_id52    ? "✅ موجود است\nشناسه رسید: " + pendingReceipt.receipt_id +53      "\nنوع: " + (pendingReceipt.type || "نامشخص")54    : "❌ پیدا نشد",55  "",56  "🗃 تعداد کل رکوردهای آرشیو: " + payments.length,57  "👤 پرداخت‌های ثبت‌شده برای این کاربر: " + userPayments.length58];59 60if (userPayments.length > 0) {61  lines.push("", "📋 جزئیات پرداخت‌های این کاربر:");62 63  for (const payment of userPayments.slice(0, 10)) {64    lines.push(65      "",66      "شناسه رسید: " + (payment.receipt_id || "نامشخص"),67      "طرح: " + (payment.plan || "نامشخص"),68      "مبلغ: " + (payment.price ?? "نامشخص"),69      "وضعیت: " + (payment.status || "نامشخص"),70      "زمان تأیید: " + (payment.approved_at || "نامشخص")71    );72  }73}74 75await Api.sendMessage({76  chat_id: chat.id,77  text: lines.join("\n")78});