mahdiyar30301/ZorenixAI_botPublic · Bot Template

Not Bot Is Hacking You 🤣🤩

Utilityutility
ProfileTelegram
455 commands2 envUpdated 7h agoCreated Aug 26, 2026
Back to folder

commands/yadmore.js

javascript · 62 lines

Raw
1/**#command2name: yadmore3answer: 4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12/**#command13name: yadmore14answer: 15keyboard: 16parse_mode: 17aliases: 18allow_only_group: false19need_reply: false20is_web: 021#command**/22 23try {24try { Api.answerCallbackQuery({}); } catch (e0) {}25var uid = "";26if (typeof user !== "undefined" && user) {27  if (user.telegramid) uid = String(user.telegramid);28  else if (user.id) uid = String(user.id);29}30if (!uid) return;31 32var list = [];33try { list = JSON.parse(String((await db.global.get("yad_list")) || "[]")); } catch (eL) { list = []; }34if (!list || typeof list.length !== "number") list = [];35 36var page = parseInt(await db.global.get("yad_page_" + uid) || 0) || 0;37page = page + 1;38var pageSize = 35;39var from = page * pageSize;40if (from >= list.length) {41  page = 0;42  from = 0;43}44await db.global.set("yad_page_" + uid, page);45 46var to = from + pageSize;47if (to > list.length) to = list.length;48var body = "یادگاری — صفحه " + (page + 1) + "\n────────────────\n";49var i = from;50for (i = from; i < to; i++) {51  if (!list[i]) continue;52  body = body + (list[i].e || "❤️") + " " + String(list[i].n || "دوست") + "\n";53}54 55var rows = [];56if (list.length > pageSize) rows.push([{ text: "ادامه لیست", callback_data: "yadmore" }]);57rows.push([{ text: "از اول", callback_data: "yad" }]);58 59Api.sendMessage({ text: body, reply_markup: { inline_keyboard: rows } });60} catch (e) {61  Bot.sendMessage("خطا yadmore");62}