stark91611/GAMA_EXPERT_BOTPublic · Bot Template

ProfileTelegram

AIThis Telegram bot offers multiple utility features including Instagram media downloading, random quote generation, AI-driven chat responses, and Pinterest image searching. It also features channel join verification, automated reaction handlers, and comprehensive administrative tools such as broadcasting and role management.

Utilityinstagramdownloaderaipinterestbroadcastadmin
15 commands0 envUpdated 24d agoCreated Sep 22, 2026
Back to folder

commands/_ask.js

javascript · 54 lines

Raw
1/**#command2name: /ask3answer: 4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12/*Command: /ask13answer: 🤔 Please ask your question14need_reply: true*/15if(!message) return ;16let question = message.trim()17if (!question || question.length === 0) {18  Bot.sendMessage("❌ Please provide a valid question!")19  return20}21let tempMsg = await Bot.sendMessage("🤔 Thinking...")22 23try {24  let response = await HTTP.get({25    url: "https://api-xqwa.onrender.com/chat/completion",26    query: {27      message: question,28      style: "chatgpt-alternative"29    }30  })31  32  if (response.ok && response.data && response.data.status === 200) {33    let aiResponse = response.data.response34    Api.editMessageText({35      chat_id: chat.id,36      message_id: tempMsg.result.message_id,37      text: "💬 *Your Question:*\n" + question + "\n\n*Answer:*\n" + aiResponse,38      parse_mode: "Markdown"39    })40  } else {41    Api.editMessageText({42      chat_id: chat.id,43      message_id: tempMsg.result.message_id,44      text: "⚠️ Sorry, I couldn't process your question. Please try again later.\n\n*Error:* API returned status " + (response.data ? response.data.status : "unknown")45    })46  }47  48} catch (error) {49  Api.editMessageText({50    chat_id: chat.id,51    message_id: tempMsg.result.message_id,52    text: "❌ An error occurred while processing your request. Please try again.\n\n*Error:* " + (error.message || "Network error")53  })54}