Flex Coder
2.06K subscribers
370 photos
63 videos
2 files
333 links
Uɴʟᴇᴀsʜ Tʜᴇ Pᴏᴡᴇʀ Oғ Bᴏᴛ Cᴏᴅɪɴɢ. Gᴇᴛ Fʀᴇᴇ Bᴏᴛ & Cᴏᴅᴇ Oɴ Oᴜʀ Cʜᴀɴɴᴇʟ 🧑‍💻

🔰 Oᴜʀ Yᴏᴜᴛᴜʙᴇ Cʜᴀɴɴᴇʟ: https://www.youtube.com/@Flex_Coder

📞 Cᴏɴᴛᴀᴄᴛ Us Oɴ: @Flex_Help
🌐 Oɴʟɪɴᴇ Fʀᴏᴍ: 3-07-2024
Download Telegram
🌐 Instant DNS record lookup for domain troubleshooting in Telegram

Nothing interrupts a product launch quite like hunting down misconfigured DNS records from a mobile device. By hooking FlexGram's built-in HTTP client directly into Google's Public DNS API, you can query live domain records inside any chat without leaving Telegram. Pass the domain directly as a command parameter or let the bot prompt you interactively.

📁 Filename: dns.js
👨‍💻 Code:
if (params) {
sendChatAction('typing')
let res = HTTP.get({ url: 'https://dns.google/resolve?name=' + params + '&type=A' })
let data = JSON.parse(res.body || '{}')
let ip = data.Answer ? data.Answer[0].data : 'No A record found'
sendMessage('🌐 *DNS Result for ' + params + '*\n\nIP Address: `' + ip + '`')
} else {
sendMessage('Type the domain name you want to query:')
waitForAnswer('get_dns')
}


📁 Filename: get_dns.js
👨‍💻 Code:
sendChatAction('typing')
let domain = message.trim().toLowerCase()
let res = HTTP.get({ url: 'https://dns.google/resolve?name=' + domain + '&type=A' })
let data = JSON.parse(res.body || '{}')
let ip = data.Answer ? data.Answer[0].data : 'No A record found'
sendMessage('🌐 *DNS Result for ' + domain + '*\n\nIP Address: `' + ip + '`')
clearWait()


💡 You can expand the query string to request MX, TXT, or CNAME records dynamically based on user needs.
⚠️ Note: Google DNS API requires no authorization keys or external environment configuration.


#FlexGram
👍1🙏1
📍 Instant Field Equipment Inspections via Telegram

Field technicians logging site visits shouldn't have to fight bloated web apps over spotty 3G signals. Our field team needed a quick, reliable way to submit equipment audits with verified GPS coordinates and photo proof directly from the chat. Using FlexGram's temporary state, chat status actions, and zero-import HTTP client, field reps complete a full site inspection log in seconds.

📁 Filename: checkin.js
👨‍💻 Code:
sendChatAction("typing")
sendMessage("📍 Please share your current location to start the site audit.")
waitForAnswer("save_location")


📁 Filename: save_location.js
👨‍💻 Code:
if (!flex.message.location) return sendMessage("⚠️ Location missing. Please send your GPS location.")
TEMP.setProperty("lat", flex.message.location.latitude)
TEMP.setProperty("lng", flex.message.location.longitude)
sendMessage("📷 Location saved! Now send a photo of the equipment setup.")
waitForAnswer("save_photo")


📁 Filename: save_photo.js
👨‍💻 Code:
if (!flex.message.photo) return sendMessage("⚠️ Photo missing. Please send a photo of the equipment.")
sendChatAction("upload_photo")
let photoId = flex.message.photo.pop().file_id
let lat = await TEMP.getProp("lat").value()
let lng = await TEMP.getProp("lng").value()
HTTP.post({ url: "https://api.fieldops.dev/v1/inspections", body: { user: user.telegramid, lat, lng, photoId } })
clearWait()
sendMessage(" *Audit Submitted!* Location coordinates and hardware snapshot are logged.")


💡 Storing temporary wizard steps in TEMP keeps multi-step conversational input in memory without cluttering persistent database tables.

⚠️ Note: Ensure your external inspection backend endpoint validates request payloads and accepts JSON body parameters.


#FlexGram
👍1🥰1
🎨 Instant Brand Asset Search in Any Chat via Inline Query

Creative agencies spend way too much time digging through messy cloud folders just to drop a clean brand bio, press kit link, or official slogan into Telegram group chats. Using FlexGram's zero-config inline handler and direct Firebase DB access, your team can query global brand assets from inside any conversation on Telegram. Just type your bot's handle followed by a keyword, and pick the ready-to-share resource right from the pop-up menu.

📁 Filename: __inline__.js
👨‍💻 Code:
const query = (inlineQuery.query || "").toLowerCase();
const assets = await getDB("brand_assets") || {};
const results = Object.keys(assets).filter(k => k.includes(query)).slice(0, 10).map(k => ({
type: "article",
id: k,
title: assets[k].title,
description: assets[k].desc,
input_message_content: { message_text: assets[k].text, parse_mode: "HTML" }
}));
await answerInlineQuery(results);


📁 Filename: addasset.js
👨‍💻 Code:
if (!params || !params.includes("|")) return sendMessage("Format: /addasset key | Title | Description | Content");
const [key, title, desc, text] = params.split("|").map(s => s.trim());
await setDB(`brand_assets/${key.toLowerCase()}`, { title, desc, text });
await sendMessage(`Asset <b>${key}</b> indexed successfully!`);


💡 Make sure to enable Inline Mode for your bot inside BotFather's Bot Settings so Telegram triggers __inline__.js updates.

⚠️ Note: Restrict addasset.js access to approved user IDs using user context properties to prevent client or public tampering with your asset database.


#FlexGram
😁1
🇮🇳 Celebrating the spirit of freedom, unity, and progress. Happy Independence Day!

Jai Hind 🫡
5🫡2
🗳️ Launch live conference stage polls without leaving Telegram

Running tech summits usually means paying for clunky third-party audience engagement tools that force attendees onto mobile web browsers. We switched to firing native Telegram polls and persistent rating keyboards directly from our backstage organizer bot during keynote talks. The entire interaction happens directly inside the attendee group chat and cleans up its own custom keyboards when the speaker steps off stage.

📁 Filename: command/livepoll.js
👨‍💻 Code:
sendChatAction('typing');
sendPoll(
'What is your team primary deployment target this quarter?',
['Kubernetes / EKS', 'Serverless Edge', 'Bare Metal / VPS', 'Managed PaaS'],
{ is_anonymous: false }
);
sendMessage('🎯 *Live audience poll dispatched.* Toggle stage feedback menu?', {
buttons: [{ text: 'Open Speaker Rating', command: '/rate_stage' }]
});


📁 Filename: command/rate_stage.js
👨‍💻 Code:
sendReplyKeyboard(
'Select your feedback for the current keynote speaker:',
[['🔥 Incredible Insights', '👍 Solid Content'], [' Needs More Demos', '😴 Too Basic']]
);


📁 Filename: command/dismiss_stage.js
👨‍💻 Code:
removeKeyboard('🎉 Rating recorded! Keyboard controls cleared for the next talk.');


💡 Native Telegram poll option labels cap out at 100 characters each, so keep your choices short and punchy to prevent API errors.

⚠️ Note: Ensure your bot is added as an administrator with posting rights if you dispatch polls into a broadcast channel.


#FlexGram
🔥1
New Video Uploaded 👇
https://youtu.be/d6r-ZqCxkkU

📹 Video Description:
In this video, I have also explained how to host the WhatsApp Bot 24/7 that was created in Part 1, so it stays online and works continuously without interruptions.

⚠️ Note: Subscribe Backup Channel: https://youtube.com/@flecdev
2👍1🔥1🥰1
🎛️ Client Audio Audition and Delivery Pipeline in Telegram

Client sign-offs on sound design clips always turn messy when you are bouncing download links back and forth across different threads. With FlexGram, you can stream compressed MP3 demos right into the chat window and let directors grab lossless master WAVs with a single button tap. The entire pipeline uses zero-import media handlers and chat action indicators to give clients instant feedback without opening an external file hosting service.

📁 Filename: command/samples.js
👨‍💻 Code:
sendMessage('🎧 *Client Review Suite*\nSelect a sound asset below to audition the draft mix in-chat:', {
buttons: [
[{ text: '🎵 Synth Lead Hook', command: '/preview synth' }, { text: '🥁 Live Drum Break', command: '/preview drums' }],
[{ text: ' Ambient Stinger FX', command: '/preview stinger' }]
]
});


📁 Filename: command/preview.js
👨‍💻 Code:
const track = params.trim();
sendChatAction('upload_document');
sendAudio(`https://cdn.example.com/audio/${track}-preview.mp3`, {
caption: `Draft preview: *${track}* (128kbps demo).\nTap below to pull the uncompressed stem.`,
buttons: [
[{ text: '📦 Deliver 24-bit WAV', command: `/master ${track}` }],
[{ text: '« Back to Catalog', command: '/samples' }]
]
});


📁 Filename: command/master.js
👨‍💻 Code:
const track = params.trim();
sendChatAction('upload_document');
sendDocument(`https://cdn.example.com/audio/${track}-master.wav`, {
caption: `Studio master for *${track}* (24-bit 48kHz WAV). Exported and ready for timeline drop.`
});


💡 Always trigger sendChatAction right before dispatching heavy audio or document payloads so the native Telegram status bar signals upload activity while your CDN resolves.

#FlexGram
2👍1🔥1👏1🤝1
📟 Zero-friction on-call shift handovers right from Telegram

Our site reliability rotations used to break down because engineers hated opening project boards just to log an active shift swap. With persistent reply keyboards and direct Firebase event writes, we turned the entire handover ritual into two instant taps from a phone. The bot pins critical ops triggers directly onto the user's input dock and clears the keyboard the moment they clock out.

📁 Filename: command/shift.js
👨‍💻 Code:
const actions = [
[{ text: "/incident" }, { text: "/swap" }],
[{ text: "/clockout" }]
];
sendReplyKeyboard("🛠 *On-call dock initialized.*\nUse the quick controls below to log activities or rotate coverage.", actions, "Markdown");


📁 Filename: command/swap.js
👨‍💻 Code:
pushDB("ops_shifts", {
engineer: user.first_name || user.username,
uid: user.id,
action: "ROTATION_COMPLETED",
time: Date.now()
});
sendMessage("📋 *Shift swap logged to database.* Standby team alerted.", { parse_mode: "Markdown" });


📁 Filename: command/clockout.js
👨‍💻 Code:
pushDB("ops_shifts", {
engineer: user.first_name || user.username,
uid: user.id,
action: "SIGNED_OFF",
time: Date.now()
});
removeKeyboard("👋 *Shift ended.* Custom dock buttons dismissed.");


💡 Always pass a clear exit prompt to removeKeyboard so your team knows their native Telegram input bar has returned to normal.

#FlexGram
🎉1
🚦 Live Staging Environment Claim Board in Telegram

Two developers accidentally deploying over each other on a shared staging server can burn an entire afternoon of debugging. Instead of managing a third-party dashboard or screaming in Slack, we turned our Telegram team chat into an instant deploy locker with shared bot state and smart in-place callback edits. Anyone can see live server occupancy and toggle locks with a single tap.

📁 Filename: command/staging.js
👨‍💻 Code:
const holder = await BOT.getProp("staging_locked_by").value();
if (holder) {
sendMessage(`🔴 *Staging 1 is LOCKED* by ${holder}`, {
buttons: [{ text: "🔓 Release Staging", command: "/unlock_staging" }]
});
} else {
sendMessage("🟢 *Staging 1 is AVAILABLE* for testing.", {
buttons: [{ text: "🔒 Claim Staging", command: "/lock_staging" }]
});
}


📁 Filename: command/lock_staging.js
👨‍💻 Code:
if (isCallback) {
answerCallback("Environment claimed!", false);
}
const claimant = user.first_name || user.username || "Anonymous Dev";
BOT.setProp("staging_locked_by", claimant);
editCallbackMessage(`🔴 *Staging 1 is LOCKED* by ${claimant}`, [
{ text: "🔓 Release Staging", command: "/unlock_staging" }
]);


📁 Filename: command/unlock_staging.js
👨‍💻 Code:
if (isCallback) {
answerCallback("Environment released!", false);
}
BOT.deleteProp("staging_locked_by");
editCallbackMessage("🟢 *Staging 1 is AVAILABLE* for testing.", [
{ text: "🔒 Claim Staging", command: "/lock_staging" }
]);


💡 Always call answerCallback first in your callback handlers to dismiss the Telegram button loading spinner immediately.

⚠️ Note: Shared status across all users is handled automatically via BOT.setProp, which syncs to your configured Firebase Realtime DB without any manual database setup.


#FlexGram
1🔥1
🗜️ Instant Production Crash Log Triage and Extraction in Telegram

When production throws an unexpected 500 error while you are away from your desk, tethering a laptop or fighting with mobile SSH clients is pure agony. We hooked our internal server metrics and diagnostics router right into FlexGram so on-call engineers can inspect real-time log snippets or request full zipped log dumps on the go. The bot triggers non-blocking server actions, pulls crash dumps across internal endpoints with HTTP, and delivers downloadable bundles straight to the chat while recording an audit record in Firebase.

📁 Filename: tail.js
👨‍💻 Code:
sendChatAction("typing");
const target = params || "backend";
const res = await HTTP.get({
url: `https://ops.internal-infra.net/logs/tail?service=${target}`
});
if (!res || !res.logs) {
sendMessage(` Unable to fetch tail output for <b>${target}</b>.`);
return;
}
sendMessage(`📋 <b>Tail output: ${target}</b>\n<pre>${res.logs}</pre>`);


📁 Filename: logs.js
👨‍💻 Code:
sendChatAction("upload_document");
const target = params || "backend";
const res = await HTTP.post({
url: "https://ops.internal-infra.net/logs/archive",
body: { service: target, requested_by: user.username || user.id }
});
if (!res || !res.file_url) {
sendMessage(` Archive generation failed for <b>${target}</b>.`);
return;
}
pushDB("audit/log_requests", { user_id: user.id, service: target, date: Date.now() });
sendDocument(res.file_url, {
caption: `🗜️ <b>Diagnostic dump:</b> <code>${target}</code>`
});


💡 Calling sendChatAction("upload_document") keeps the Telegram status bar active for your users while heavy server archives are building in the background.

⚠️ Note: Protect sensitive internal endpoints by ensuring your bot server's outbound IP is allowlisted on your private network firewall.


#FlexGram
😍1
🖼️ Instant Social Card & OpenGraph Previews in Telegram

Marketing teams always seem to catch broken social share cards right after pushing a high-profile launch live. Instead of jumping onto a laptop and opening third-party scrapers or debugging tools, we can pipe the live metadata and image renders directly into Telegram. Using zero-import HTTP helpers and native media actions, you can test both the visual thumbnail card and raw server response headers in a couple of seconds.

📁 Filename: command/preview.js
👨‍💻 Code:
if (!params) return sendMessage("<b>Usage:</b> <code>/preview https://example.com</code>");
sendChatAction("upload_photo");
const res = await HTTP.get({ url: `https://api.microlink.io?url=${encodeURIComponent(params)}` });
if (!res?.data?.image?.url) return sendMessage(" Could not extract OpenGraph metadata from that URL.");
const { title, description, image } = res.data;
sendPhoto(image.url, {
caption: `🌐 <b>${title || "No title"}</b>\n\n${description || "No description"}\n\n🔗 <code>${params}</code>`
});


📁 Filename: command/headers.js
👨‍💻 Code:
if (!params) return sendMessage("<b>Usage:</b> <code>/headers https://example.com</code>");
sendChatAction("typing");
const res = await HTTP.custom({ url: params, method: "HEAD" });
const cache = res?.headers?.["cache-control"] || "none";
const server = res?.headers?.["server"] || "hidden";
const type = res?.headers?.["content-type"] || "unknown";
sendMessage(`📡 <b>Response Headers</b>\n\n• <b>Target:</b> <code>${params}</code>\n• <b>Content-Type:</b> <code>${type}</code>\n• <b>Cache-Control:</b> <code>${cache}</code>\n• <b>Server:</b> <code>${server}</code>`);


💡 Always trigger sendChatAction right before long-running HTTP fetches so users get visual feedback while external metadata APIs resolve.

#FlexGram
👍1🏆1
Just Completed 100 Followers on GITHUB 🥳

GITHUB PROFILE
3👍2🎉2
🎙️ Async Creative Brief & Audio Intake Flow in Telegram

Chasing clients across messy email threads for campaign specs and voice notes kills creative momentum before production even begins. We replaced that chaotic back-and-forth with a streamlined 3-step intake bot that captures project titles, accepts raw voice notes or attachments, and commits the submission directly into Firebase. Clients get an effortless onboarding experience on mobile while our studio receives neatly indexed brief records.

📁 Filename: command/brief.js
👨‍💻 Code:
sendMessage("Let's get your creative project rolling. Reply with the client or campaign name:");
waitForAnswer("/brief_name");


📁 Filename: command/brief_name.js
👨‍💻 Code:
TEMP.setProp("campaign", message);
sendMessage("Great! Now send your audio voice memo brief or attach your scope document:");
waitForAnswer("/brief_asset");


📁 Filename: command/brief_asset.js
👨‍💻 Code:
const campaign = await TEMP.getProp("campaign").value();
pushDB("project_briefs", {
user_id: user.id,
username: user.username || user.first_name,
campaign: campaign,
message_id: message_id,
submitted_at: Date.now()
});
clearWait();
sendMessage(" Creative brief for *" + campaign + "* logged successfully! Our team will review the audio assets.");


💡 Always call clearWait() immediately after saving the final step so unexpected follow-up text routes back to your default message handler instead of triggering the upload logic again.

⚠️ Note: Ensure FIREBASE_URL and FIREBASE_SECRET are configured in your environment so pushDB can generate persistent records.


#FlexGram
🏆2
New Video Uploaded 👇
https://youtu.be/wBCKvhrqzag

📹 Video Description:
In this video i have told how to create viral ai videos for free

⚠️ Note: Subscribe Backup Channel: https://youtube.com/@flecdev
🤩1
🏆 Team Sprint Kudos Pool & Reward Ledger in Telegram

Keeping engineering morale high during crunch weeks doesn't require a bloated third-party SaaS subscription. We set up an internal micro-kudos bank in Telegram where developers claim a daily allowance and tip tokens into a shared sprint pool. Persistent USER and BOT properties handle isolated balances and global tally tracking automatically with zero database boilerplate.

📁 Filename: daily.js
👨‍💻 Code:
const claimed = await USER.getProp('daily_claimed').value();
const today = new Date().toISOString().slice(0, 10);
if (claimed === today) {
sendMessage(' You already claimed your 50 daily kudos for today!');
return;
}
USER.setProp('daily_claimed', today);
const balance = (await USER.getProp('balance').value()) || 0;
USER.setProp('balance', balance + 50);
sendMessage('🎁 Credited *50 kudos* to your account! Check the ledger via `/pot` or tip the pool with `/tip 10`.');


📁 Filename: tip.js
👨‍💻 Code:
const amount = Math.max(1, parseInt(params, 10) || 10);
const balance = (await USER.getProp('balance').value()) || 0;
if (balance < amount) {
sendMessage(`⚠️ Insufficient balance! You have *${balance}* kudos available.`);
return;
}
USER.setProp('balance', balance - amount);
const pool = (await BOT.getProp('sprint_pool').value()) || 0;
BOT.setProp('sprint_pool', pool + amount);
const totalTipped = (await USER.getProp('total_tipped').value()) || 0;
USER.setProp('total_tipped', totalTipped + amount);
sendMessage(` You pitched *${amount}* kudos into the sprint pot! Current balance: *${balance - amount}*.`);


📁 Filename: pot.js
👨‍💻 Code:
const pool = (await BOT.getProp('sprint_pool').value()) || 0;
const tipped = (await USER.getProp('total_tipped').value()) || 0;
const balance = (await USER.getProp('balance').value()) || 0;
sendMessage(`🏆 *Sprint Kudos Ledger*\n\n🔥 Total Team Pot: *${pool}* kudos\n👤 Your Contributions: *${tipped}* kudos\n💰 Available Balance: *${balance}* kudos`, {
buttons: [
[
{ text: "🎁 Claim Daily Kudos", command: "/daily" },
{ text: " Tip 10 Kudos", command: "/tip 10" }
]
]
});


💡 BOT.setProp syncs across all members instantly while USER.setProp guarantees each developer's balance stays strictly scoped to their Telegram ID.

⚠️ Note: Make sure FIREBASE_URL and FIREBASE_SECRET are configured in your environment so properties persist seamlessly between deployments.


#FlexGram
👍1😁1
Suggest me idea for video

Comment down 👇
👍1👏1
🎪 One-Tap On-Site Event Runner Controls in Telegram

Getting non-technical stagehands and booth staff to run slash commands during noisy live events is a recipe for missed handoffs. Instead of making them type out updates while juggling gear, I spin up an ephemeral reply keyboard that turns the Telegram composer into a customized 4-button hardware pad. Staff tap once to claim zones or raise urgent flags, and the keyboard cleans itself up as soon as they sign out.

📁 Filename: crew.js
👨‍💻 Code:
sendReplyKeyboard(
"<b>Crew Mode active.</b> Tap a station button to log your position or hail the lead desk:",
[["📍 Main Stage", "📍 Expo Hall"], ["🚨 Tech Assist", "🏁 Drop Shift"]]
);


📁 Filename: __message__.js
👨‍💻 Code:
if (message === "🏁 Drop Shift") {
USER.deleteProp("station");
removeKeyboard("Shift ended. Custom keyboard dismissed.");
} else if (message === "🚨 Tech Assist") {
sendMessage(`🚨 <b>Urgent Alert:</b> Runner ${user.first_name} needs immediate backup at their post!`);
} else if (message.startsWith("📍")) {
USER.setProp("station", message.replace("📍 ", ""));
sendMessage(`Logged current post as <b>${message}</b>.`);
}


📁 Filename: status.js
👨‍💻 Code:
const station = await USER.getProp("station").value();
if (!station) {
sendMessage("No active station logged. Send /crew to bring up your station pad.");
} else {
sendMessage(`👤 <b>Runner:</b> ${user.first_name}\n📍 <b>Active Post:</b> ${station}`);
}


💡 Always pass your closing confirmation message directly into removeKeyboard(text) so the custom input tray vanishes in the very same frame the user signs off.

#FlexGram
👍1👌1
📢 Scheduled Maintenance Outage Broadcast Dispatcher

Blasting scheduled maintenance alerts across your entire user base shouldn't require third-party email tools or wrestling with Telegram API 429 rate limit spikes. With FlexGram, you can record subscriber chat targets directly to Firebase and let the built-in throttled broadcast engine safely push the warning out to everyone in sequence. Here is how I set up instant downtime dispatches for all platform subscribers.

📁 Filename: command/subscribe.js
👨‍💻 Code:
const alertTarget = user.username ? `@${user.username}` : user.first_name;
await setDB(`subscribers/${user.id}`, { id: user.id, user: alertTarget });
sendMessage(`🔔 *Status Alerts Active*\nYou will receive real-time notifications before scheduled server maintenance.`);


📁 Filename: command/broadcast_maintenance.js
👨‍💻 Code:
sendChatAction("typing");
const subs = await getDB("subscribers");
const userIds = subs ? Object.keys(subs) : [];
const notice = `⚠️ *System Maintenance Notice*\n\nDatabase migration starts in 15 minutes. Bot APIs will be briefly paused.`;
const buttons = [{ text: "Live Status Page", url: "https://status.example.com" }];
const report = await broadcast(userIds, notice, buttons, 40);
sendMessage(`📡 *Dispatch Complete*\nDelivered: *${report.sent}*\nFailed: *${report.failed}*`);


💡 Setting your broadcast delay around 35ms to 50ms keeps your dispatch comfortably within Telegram rate limits while finishing large recipient queues quickly.

⚠️ Note: Lock broadcast_maintenance.js behind an admin ID check or private bot property so unauthorized users cannot trigger mass broadcasts.


#FlexGram
🥰1