455 commands2 envUpdated 7h agoCreated Aug 26, 2026
commands/mood_good.js
javascript · 54 lines
1/**#command2name: mood_good3answer: 4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12// کامند: mood_good13try {14 var uid = "";15 if (typeof user !== "undefined" && user) {16 if (user.telegramid) uid = String(user.telegramid);17 else if (user.id) uid = String(user.id);18 }19 if (!uid) { Bot.sendMessage("uid نیست"); return; }20 21 var chatId = uid;22 if (typeof chat !== "undefined" && chat) {23 if (chat.chatid) chatId = chat.chatid;24 else if (chat.id) chatId = chat.id;25 }26 27 await db.global.set("last_ask_uid_" + chatId, uid);28 await db.global.set("last_status_" + uid, "🌤️ مود");29 await db.global.set("last_user_prompt_" + uid, "mood: خوب و مثبت");30 31 try { Api.sendChatAction({ chat_id: chatId, action: "typing" }); } catch (e0) {}32 Bot.sendMessage("🌤️ دارم برات جواب آماده میکنم...");33 34 HTTP.post({35 url: "https://api.groq.com/openai/v1/chat/completions",36 headers: {37 "Authorization": "Bearer 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",38 "Content-Type": "application/json"39 },40 body: {41 model: "openai/gpt-oss-20b",42 messages: [43 { role: "system", content: "همراه همدل فارسی. کوتاه جواب بده. نه پزشک. همدلی + یک تمرین کوتاه." },44 { role: "user", content: "حال من: خوب و مثبت" }45 ],46 max_tokens: 40047 },48 background: true,49 success: "/onAiSuccess",50 error: "/onAiError"51 });52} catch (e) {53 Bot.sendMessage("⚠️ خطا mood_good:\n" + String(e && e.message ? e.message : e));54}