Flex Coder: post #1568 โ€” TG.ME

๐ŸŽจ 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
August 14, 2026 155