Flex Coder
2.06K subscribers
370 photos
63 videos
2 files
334 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
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
👨‍🍳 Kitchen Expediter & Order Ticket Stepper in Telegram

Tablets in hot commercial kitchens get covered in grease and inevitably crack, so we swapped expensive kitchen display hardware for Telegram group chat order tickets. Staff receive new incoming tickets right in their line chat and step each order through preparation stages using instant inline callback buttons. The entire order card updates in place with editCallbackMessage without spamming notifications, popping an instant alert when a ticket is ready for runners.

📁 Filename: command/order.js
👨‍💻 Code:
const ticketId = params || Math.floor(1000 + Math.random() * 9000);
const orderCard = `🍽 *Order #${ticketId}*\n*Items:* 2x Smash Burger, 1x Truffle Fries\n*Status:* Queued`;
const buttons = [[{ text: "👨‍🍳 Claim Ticket", command: `/claim` }]];
sendMessage(orderCard, { buttons });


📁 Filename: command/claim.js
👨‍💻 Code:
if (!isCallback) return;
const chefName = user.username ? `@${user.username}` : user.first_name;
const updatedText = message.replace(" Queued", `🔥 Prepping (Chef: ${chefName})`);
const buttons = [[{ text: "🔔 Mark Ready for Pickup", command: "/ready" }]];
answerCallback("You claimed this ticket!");
editCallbackMessage(updatedText, buttons);


📁 Filename: command/ready.js
👨‍💻 Code:
if (!isCallback) return;
const updatedText = message.replace(/🔥 Prepping.*?\)/, " Ready for Runner");
const buttons = [[{ text: "📦 Handed Off / Archive", command: "/archive" }]];
answerCallback("Order is up! Runner alert dispatched.", true);
editCallbackMessage(updatedText, buttons);


📁 Filename: command/archive.js
👨‍💻 Code:
if (!isCallback) return;
answerCallback("Ticket archived");
deleteMessage(message_id);


💡 Passing true as the second argument to answerCallback turns Telegram's subtle toast into an intrusive modal popup, perfect for loud line kitchens where runners need immediate visual confirmation.

#FlexGram
👍1🤩1
🚀 Trigger and Monitor Headless Static Builds from Telegram

Whenever a client messages asking why their freshly edited CMS article isn't live yet, logging into cloud hosting dashboards from a phone browser is painfully slow. Wiring static site build webhooks directly into FlexGram lets you fire off builds and query status checks in one tap without leaving Telegram. The zero-import HTTP global handles webhook dispatching effortlessly.

📁 Filename: command/deploy.js
👨‍💻 Code:
sendMessage("🚀 *Select build target:*", {
buttons: [
[{ text: "📦 Staging Rebuild", command: "/run_deploy staging" }],
[{ text: " Production Rebuild", command: "/run_deploy production" }]
]
});


📁 Filename: command/run_deploy.js
👨‍💻 Code:
sendChatAction("typing");
const target = params || "staging";
const hookUrl = target === "production"
? "https://api.buildhost.com/v1/hooks/prod"
: "https://api.buildhost.com/v1/hooks/stage";
const res = HTTP.post({
url: hookUrl,
body: { trigger: "telegram", user: user.username || user.first_name }
});
USER.setProp("last_target", target);
sendMessage(`🔨 *${target.toUpperCase()}* build triggered.\nQueue ID: \`${res?.data?.id || "active"}\``, {
buttons: [{ text: "🔍 Check Live Status", command: "/build_status" }]
});


📁 Filename: command/build_status.js
👨‍💻 Code:
sendChatAction("typing");
const target = await USER.getProp("last_target").value() || "staging";
const res = HTTP.get({ url: `https://api.buildhost.com/v1/status/${target}` });
const status = res?.data?.status || "deployed";
sendMessage(`📊 *Environment:* \`${target}\`\nStatus: *${status.toUpperCase()}*`, {
buttons: [
[{ text: "🔄 Refresh", command: "/build_status" }],
[{ text: "🚀 Deploy Menu", command: "/deploy" }]
]
});


💡 Always trigger sendChatAction("typing") right before running third-party HTTP calls so the user gets instant visual feedback while external webhooks process.

⚠️ Note: Replace the mock buildhost API endpoints with your actual hosting provider's build hook and status URLs.


#FlexGram
1
🪪 Self-Serve Data Center Access Badging and Audit Logging

Auditing physical contractor access into colocation server halls usually turns into a headache of paper logbooks and forgotten checkout times. With this workflow, visiting engineers select their assigned server hall from a clean reply keyboard, receive their entry credentials and compliance brief as a document, and get logged directly into Firebase. Once maintenance wraps up, checking out clears their session and records their exit timestamp instantly.

📁 Filename: command/visit.js
👨‍💻 Code:
sendReplyKeyboard("Select your assigned server hall for today's maintenance:", [
["Hall Alpha (Racks 1-20)"],
["Hall Beta (Racks 21-40)"],
["Cage C (High-Density SAN)"]
])
waitForAnswer("/grant_access")


📁 Filename: command/grant_access.js
👨‍💻 Code:
clearWait()
removeKeyboard("Target zone recorded.")
FLEX.setProperty("active_zone", message)
pushDB("audit_logs/colocation", {
engineer_id: user.id,
engineer_name: user.first_name,
zone: message,
action: "checkin",
timestamp: Date.now()
})
sendDocument("https://assets.internal.net/dc-compliance-pass.pdf", {
caption: `Access granted for *${message}*. Keep your digital pass accessible at all times.`,
parse_mode: "Markdown"
})


📁 Filename: command/leave.js
👨‍💻 Code:
const zone = await FLEX.getProperty("active_zone").value()
if (!zone) {
sendMessage("No active data hall check-in found for your account.")
return
}
FLEX.deleteProperty("active_zone")
pushDB("audit_logs/colocation", {
engineer_id: user.id,
engineer_name: user.first_name,
zone: zone,
action: "checkout",
timestamp: Date.now()
})
sendMessage(`Checked out of *${zone}*. Security gate has been notified.`, { parse_mode: "Markdown" })


💡 Always call removeKeyboard() right when consuming reply keyboard input so custom buttons don't linger on the technician's screen.

⚠️ Note: Ensure FIREBASE_URL and FIREBASE_SECRET are configured so audit logs and user property states persist across server restarts.


#FlexGram
1👍1
💀 Surprise Code (Made for educational purposes)


Can simple JavaScript actually make your browser freeze or crash?. Check out the GitHub repo and test it yourself

🔗 GitHub: Visit Repo

⚠️ WARNING
Don't run this on your main browser
Don't run it on someone else's device
It can freeze/crash your browser and make you lose unsaved work
Test only on your own device
🧪 Try experimenting with a small number of tabs and see how your browser handles it.

What other crazy but safe browser experiments should I build 🤔?
Drop your ideas below 👇
👍4
📦 Automated Office Parcel Reception & Shelf Staging

Front desk clipboards and lost courier notes become an absolute nightmare once your team scales past twenty people. Instead of building a bespoke mobile check-in app, you can give your reception team a lightning-fast reply keyboard workflow that records delivery shelf locations into Firebase and updates aggregate totals instantly. The floor staff taps one button to record the delivery bay, the persistent reply keyboard resets cleanly, and the intake queue updates in real time.

📁 Filename: drop.js
👨‍💻 Code:
sendReplyKeyboard("Select the arrival shelf zone for this parcel:", [
["Bay A - General", "Bay B - Secure Lockbox"],
["Bay C - Cold Storage", "Front Desk Holding"]
])
waitForAnswer("confirm_drop")


📁 Filename: confirm_drop.js
👨‍💻 Code:
clearWait()
const zone = message
pushDB("deliveries/inbound", {
zone: zone,
logged_by: user.first_name,
received_at: Date.now()
})
BOT.add("inbound_parcel_count", 1)
removeKeyboard(`Logged parcel to *${zone}*! Inventory tally updated.`)


📁 Filename: parcels.js
👨‍💻 Code:
const count = await BOT.getProp("inbound_parcel_count").value() || 0
sendMessage(`🏢 *Facility Parcel Hub*\nTotal inbound packages processed: *${count}*`, {
buttons: [{ text: "Log New Drop", command: "/drop" }]
})


💡 Calling removeKeyboard directly with a message string removes the custom keypad layout and posts your confirmation text in one clean step.

⚠️ Note: Ensure your FIREBASE_URL and FIREBASE_SECRET are configured so pushDB writes persist directly into your database.


#FlexGram
1👍1
Are ads showing below 🤔?

click on it for some help 😉
👍2🐳1
🚐 Zero-Friction Morning Fleet Inspection & Mileage Intake

Depot drivers will skip vehicle walkaround sheets nine times out of ten if they have to fill out paper clipboards or download heavy native apps. Routing pre-trip logs right into Telegram lets drivers send odometer numbers, select condition tags off a custom reply keyboard, and strip the keyboard away the moment their route is approved. Everything syncs straight to the dispatch database before the van even exits the lot.

📁 Filename: inspect.js
👨‍💻 Code:
sendMessage(`Hey ${user.first_name}, let's log your morning pre-trip inspection. Reply with your current van odometer mileage:`)
waitForAnswer('record_mileage')


📁 Filename: record_mileage.js
👨‍💻 Code:
TEMP.setProperty('van_odometer', message)
sendReplyKeyboard('Select vehicle exterior and tire condition:', [
['🟢 All Clear - Good to Go', '🟡 Minor Scuff / Dirty'],
['🔴 Maintenance Required']
])
waitForAnswer('finish_inspection')


📁 Filename: finish_inspection.js
👨‍💻 Code:
const odo = await TEMP.getProp('van_odometer').value()
pushDB('fleet_inspections', {
driver: user.first_name,
driver_id: user.id,
mileage: odo,
condition: message,
timestamp: new Date().toISOString()
})
clearWait()
removeKeyboard(`Inspection submitted! Mileage: ${odo} km | Status: ${message}. Drive safe today!`)


💡 Calling removeKeyboard() immediately wipes custom reply buttons from the chat view so the driver's standard keyboard returns the second their submission finishes.

⚠️ Note: Ensure your database rules allow authenticated REST writes from the bot backend to the fleet_inspections path.


#FlexGram
2👍1