🚗
Vechile Info Bot Code [Bots Business]💓
Command : *
🔍 BJS :function encodeVehicleNumber(vehicleNumber) {
return encodeURIComponent(vehicleNumber);
}
var vehicleNumber = message; // user input
var encodedVehicleNumber = encodeVehicleNumber(vehicleNumber);
// Make the HTTP GET request
HTTP.get({
url: "https://botmaker.serv00.net/vehicle-info.php?number=" + encodedVehicleNumber,
success: "/onVehicleInfoResponse" // Define this command to handle the response
});
💓
Command : /onVehicleInfoResponse
🔍 BJS :var response = JSON.parse(content); // Parse the API response
if (response.status === "success") {
var data = response.data; // Extract the data object
// Format the message with emojis, bold, mono, and double line breaks
var message = "🚗 *Vehicle Details* 🚗\n\n";
message += "🔢 *Vehicle Number*: `" + (data.VEHICLE_NUM || "N/A") + "`\n\n";
message += "🏢 *Brand*: `" + (data.BRAND || "N/A") + "`\n\n";
message += "🚙 *Model*: `" + (data.VEHICLE_MODEL || "N/A") + "`\n\n";
message += "👤 *Owner*: `" + (data.NAME || "N/A") + "`\n\n";
message += "🛡️ *Role*: `" + (data.ROLE || "N/A") + "`\n\n";
message += "🏦 *Insurance By*: `" + (data.INSURANCE_BY || "N/A") + "`\n\n";
message += "📅 *Insurance Expiry*: `" + (data.insurance_Expiry_Date || "N/A") + "`\n\n";
message += "⏳ *Days Left*: `" + (data.DAYS_LEFT || "N/A") + "`\n\n";
message += "👥 *Owner Number*: `" + (data.OWNER_NUM || "N/A") + "`\n\n";
message += "🏗️ *Commercial*: `" + (data.isCommercial || "N/A") + "`\n\n";
message += "🗓️ *Registration Date*: `" + (data.REG_DATE || "N/A") + "`\n\n";
message += "🤑 *Eligible for Sell*: `" + (data.SELL_ELIGIBLE || "N/A") + "`\n\n";
message += "🛍️ *Eligible for Buy*: `" + (data.BUY_ELIGIBLE || "N/A") + "`\n\n";
message += "🔍 *Probable Vehicle Number*: `" + (data.PROBABLE_VEHICLE_NUM || "N/A") + "`\n\n";
message += "📅 *Date of Insurance Expiry*: `" + (data.date_of_insurance_expiry || "N/A") + "`\n\n";
message += "🎂 *Vehicle Age*: `" + (data.AGE || "N/A") + "`\n\n";
message += "🛡️ *Insurance Eligible*: `" + (data.INSURANCE_ELIGIBLE || "N/A") + "`\n\n";
message += "❌ *Is Expired*: `" + (data.IS_EXPIRED || "N/A") + "`\n\n";
message += "❌ *Insurance Expired*: `" + (data.INSURANCE_EXPIRED || "N/A") + "`\n\n";
message += "📍 *Pincode*: `" + (data.PINCODE || "N/A") + "`\n\n";
message += "🚘 *Probable Vehicle Type*: `" + (data.PROBABLE_VEHICLE_TYPE || "N/A") + "`\n\n";
message += "📲 *Source App*: `" + (data.SRC_APP || "N/A") + "`\n\n";
message += "🛑 *Interstitial*: `" + (data.INTERSTITIAL || "N/A") + "`\n\n";
message += "👤 *User ID*: `" + (data.USERID || "N/A") + "`\n\n";
message += "📅 *Created At*: `" + (data.CREATED_AT || "N/A") + "`\n\n";
message += "📆 *Expiring Today*: `" + (data.expiringtoday || "N/A") + "`\n\n";
message += "📆 *Expiring in One Day*: `" + (data.expiringinoneday || "N/A") + "`\n\n";
message += "🚗 *Vehicle Type*: `" + (data.VEHICLE_TYPE || "N/A") + "`\n\n";
message += "🔒 *Is Logged*: `" + (data.IS_LOGGED || "N/A") + "`\n\n";
message += "📱 *App Open Count*: `" + (data.APP_OPEN || "N/A") + "`\n\n";
message += "🚙 *Probable Vehicle Model*: `" + (data.PROBABLE_VEHICLE_MODEL || "N/A") + "`\n\n";
if (response.image) {
message += "🖼️ *Vehicle Image*: [Click here](" + response.image + ")\n\n";
} else {
message += "🖼️ *Vehicle Image*: `Image not available`\n\n";
}
// Use the Api.sendMessage method to send the formatted message
Api.sendMessage({
text: message,
parse_mode: "Markdown" // Ensure proper formatting
});
} else {
// Handle cases where the API response status is not "success"
Api.sendMessage({
text: "❌ Failed to fetch vehicle information. Please try again.\n\n",
parse_mode: "Markdown"
});
}
⚠️ Give credit if you are posting on your channel.
👨💻 Created By: @Swastik_Raj
© Credit: @Privates_Bots