CREATORS/OnecreatorsbotPublic · Bot Template
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
commands/_teststorage.js
javascript · 75 lines
1/**#command2name: /teststorage3answer: 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 testKey = "creators_payment_archive_test";24 25const existing = await db.bot.get(testKey, null);26 27if (existing !== null && existing !== undefined) {28 await Api.sendMessage({29 chat_id: chat.id,30 text:31 "آزمایش قبلاً انجام شده است.\n" +32 "مقدار ذخیرهشده: " + JSON.stringify(existing)33 });34 return;35}36 37const testData = [38 {39 id: "TEST-001",40 amount: 500000,41 status: "approved"42 },43 {44 id: "TEST-002",45 amount: 2000000,46 status: "approved"47 }48];49 50await db.bot.set(testKey, testData);51 52const saved = await db.bot.get(testKey, null);53 54if (55 Array.isArray(saved) &&56 saved.length === 2 &&57 saved[0].id === "TEST-001" &&58 saved[1].id === "TEST-002"59) {60 await Api.sendMessage({61 chat_id: chat.id,62 text:63 "✅ آزمایش موفق بود.\n\n" +64 "دو رکورد مستقل ذخیره و دوباره خوانده شدند.\n" +65 "اکنون میتوانیم ساختار آرشیو پرداخت را طراحی کنیم."66 });67} else {68 await Api.sendMessage({69 chat_id: chat.id,70 text:71 "⚠️ نتیجه ذخیرهسازی مطابق انتظار نبود.\n\n" +72 "خروجی خواندهشده:\n" +73 JSON.stringify(saved)74 });75}