Web appOpen in Telegram
TTBL Codes

TBL Codes

@TBHCodes · channel · Tech · indexed since 2026-04-17
310subscribers
84posts in the index
TBL Codes
📌 TTS Generator TBH Code 📌 This code is tested & working perfectly ✅ 📜 Description: Advanced Text-to-Speech generator that converts text into natural speech audio and supports 10 languages with high-quality voice output also to view more languages & voice accents click here 🚀 Command: /tts ⏳ Wait for answer: ❌ Off 🛠 TBH Code: let textToConvert = ""; let languageToUse = "en"; if (params) { let parts = params.trim().split(" "); let supportedLanguages = ['en','hi','ur','ta','es','fr','de','it','ru','ja']; let lastPart = parts[parts.length - 1].toLowerCase(); if (parts.length >= 2 && supportedLanguages.includes(lastPart)) { textToConvert = parts.slice(0, -1).join(" "); languageToUse = lastPart; } else { textToConvert = params; } } else { Api.sendMessage({ chat_id: chat.id, text: "❌ Please provide text to convert!\n\n<b>Usage:</b>\n• /tts <code>{text} {langcode}</code>\n• /tts <code>{text}</code>\n\n<b>Example:</b>\n• <code>/tts hello</code>\n• <code>/tts hello en</code>", parse_mode: "HTML", reply_to_message_id: msg.message_id }); return; } if (!textToConvert.trim()) { Api.sendMessage({ chat_id: chat.id, text: "❌ No text found to convert!", parse_mode: "HTML", reply_to_message_id: msg.message_id }); return; } if (textToConvert.length > 500) { Api.sendMessage({ chat_id: chat.id, text: "❌ Text too long. Maximum 500 characters allowed.", parse_mode: "HTML", reply_to_message_id: msg.message_id }); return;} let statusMsg = await Api.sendMessage({ chat_id: chat.id, text: "🔄 Processing your TTS request... This may take a few seconds", parse_mode: "HTML", reply_to_message_id: msg.message_id}); try { Api.sendChatAction({ chat_id: chat.id, action: "upload_audio" }); let response = await HTTP.post({ url: "https://flashcomapi.alwaysdata.net/api/tts-free", body: { text: textToConvert.trim(), language: languageToUse, telegram_id: user.id.toString(), provider: "gs" //You can change to 'vi' read more: https://telegra.ph/Free-TTS-API---Voice-Models-Documentation-11-05 }, headers:
10 · 934 ·
T
TBL Codes
/*Command: /img aliases: imghost, host, upload Usage: Method 1: /img <image_url> Method 2: Reply to an image with /img Example: /img https://example.com/image.png or reply to any image with /img */ let imageUrl = null let repliedMsg = null if (request && request.reply_to_message) { repliedMsg = request.reply_to_message } else if (msg && msg.reply_to_message) { repliedMsg = msg.reply_to_message } if (repliedMsg) { if (repliedMsg.photo && repliedMsg.photo.length > 0) { let photo = repliedMsg.photo[repliedMsg.photo.length - 1] let fileId = photo.file_id try { let fileInfo = await Api.getFile({ file_id: fileId }) if (fileInfo && fileInfo.ok && fileInfo.result && fileInfo.result.file_path) { imageUrl = "https://api.telegram.org/file/bot" + bot.token + "/" + fileInfo.result.file_path } else { Bot.sendMessage("❌ Failed to get image file path from Telegram") return } } catch (e) { Bot.sendMessage("❌ Error getting image: " + (e.message || "Unknown error")) return } } else if (repliedMsg.document) { let doc = repliedMsg.document if (doc.mime_type && doc.mime_type.startsWith("image/")) { let fileId = doc.file_id try { let fileInfo = await Api.getFile({ file_id: fileId }) if (fileInfo && fileInfo.ok && fileInfo.result && fileInfo.result.file_path) { imageUrl = "https://api.telegram.org/file/bot" + bot.token + "/" + fileInfo.result.file_path } else { Bot.sendMessage("❌ Failed to get document file path from Telegram") return } } catch (e) { Bot.sendMessage("❌ Error getting document: " + (e.message || "Unknown error")) return } } else { Bot.sendMessage("❌ The replied file is not an image") return } } else { Bot.sendMessage("❌ Please reply to a photo or image file") return } } if (!imageUrl) { if (!params || params.trim() =
15 · 964 ·
T
TBL Codes
💡 Telegram Tip: Image Cache! When you send images by URL, Telegram caches them on their CDN. That means if you update the image on your server, Telegram won’t fetch the new version automatically. ✅ Fix: Add a random query parameter to the URL: https://example.com/photo.png?v=12345 This forces Telegram to download the latest version every time.
1 · 834 ·
TBL Codes
Force Channel Join Tbh Code Command /start Code: await Api.sendMessage({ chat_id: chat.id, text: "*Please join our channel to continue.*\n\n_Join first, then tap “I Joined”._", parse_mode: "Markdown", reply_markup: { inline_keyboard: [ [{ text: "Join Channel", url: "https://t.me/Mrnull9" }], [{ text: "I Joined", callback_data: "check_join" }] ] } }); Command check_join Code: let channels = ["@Mrnull9"]; let res = await Libs.mcl.check(user.id, channels); let mid = request.message.message_id; if (res.all_joined === true) { Api.editMessageText({ chat_id: chat.id, message_id: mid, text: "*Verification Complete!*\n\n_You may continue now._", parse_mode: "Markdown" }); } else { Api.editMessageText({ chat_id: chat.id, message_id: mid, text: "*You have not joined yet.*\n\n_Please join first, then tap “Check Again”._", parse_mode: "Markdown", reply_markup: { inline_keyboard: [ [{ text: "Join Channel", url: "https://t.me/Mrnull9" }], [{ text: "Check Again", callback_data: "check_join" }] ] } }); } Credit & Devloped By: @Raghav768 Telegram Channel: @MrNull9
7 · 745 ·
T
ReplyForce Channel Join Tbh Code Command /start Code: await Api.sendMessage({ chat_id: chat.id, text: "*Please join our channel to continue.*\n\n_Join first, then tap “I Joined”._", parse_mode: "Markdown", reply_markup: { inline_keyboard: [ [{ text: "Join Channel", url: "https://t.m
Little Upgraded version command: @ const channels = [   "@Mrnull9" ] command: /start const ik = []; for (const c of channels) {   ik.push([     {       text: "Join to " + c,       url: "tg://resolve?domain=" + c.slice(1)     }   ]); } ik.push([   {     text: "I Joined",     callback_data: "check_join"   } ]); Api.sendMessage({   text: "Please join our channel to continue.*\n\n_Join first, then tap “I Joined”._",   reply_markup: {     inline_keyboard: ik   } }); command: check_join const ik = []; // again??? const res = await Libs.mcl.check(user.id, channels); const allJoined = res.all_joined; const text = allJoined   ? "*Verification Complete!*\n\n_You may continue now._"   : "*You have not joined yet.*\n\n_Please join first, then tap “Check Again”._"; for (const c of channels) {   ik.push([     {       text: "Join to " + c,       url: "tg://resolve?domain=" + c.slice(1)     }   ]); } ik.push([   {     text: "Check again",     callback_data: "check_join"   } ]); Api.editMessageText({   text,   message_id: request?.message?.message_id,   parse_mode: "Markdown",   reply_markup: {     inline_keyboard: !allJoined ? ik : undefined   } }); By : @vinadira
13 · 1K ·
T
TBL Codes
Example of using emoji effect Command - /start Api.sendMessage({     chat_id: user.telegramid,     text: "🎉 Celebration effect message",     parse_mode: "Markdown",     message_effect_id: "5046509860389126442" }); '🔥': "5104841245755180586", '👍': "5107584321108051014", '🎉': "5046509860389126442", '👎': "5104858069142078462", '❤️': "5044134455711629726",
12 · 1.2K ·
T
TBL Codes
⭐ TBL Tip: Use Any Telegram API Method Dynamically! If a method isn’t available in TBL’s Api.xxx, you can still call it: Api.call("methodName", { /* params */ }) Example: Api.call("getChat", { chat_id: -1007657565746 }) Use any new Telegram method instantly 🚀 Docs: https://telebothost.com/docs/#api-dynamic
6 · 2K ·
T
TBL Codes
Link shortner TBL codes Command: /short Use: /short <long_link> TBL code: /* Command: /short */ if (!params) { Api.sendMessage({ chat_id: chat.id, text: "❌ <b>Missing URL</b>\n\n" + "👉 <b>Usage:</b>\n" + "<code>/short https://example.com</code>\n\n" + "Please send a valid long link.", parse_mode: "HTML" }) return } let longUrl = params.trim() if (!longUrl.startsWith("http://") && !longUrl.startsWith("https://")) { Api.sendMessage({ chat_id: chat.id, text: "❌ <b>Invalid URL</b>\n\n" + "URL must start with:\n" + "<code>http://</code> or <code>https://</code>", parse_mode: "HTML" }) return } Api.sendChatAction({ chat_id: chat.id, action: "typing" }) let res = await HTTP.get({ url: "https://tinyurl.com/api-create.php", query: { url: longUrl } }) if (!res || !res.content) { Api.sendMessage({ chat_id: chat.id, text: "⚠️ <b>Failed to shorten the link</b>\n" + "Please try again later.", parse_mode: "HTML" }) return } Api.sendMessage({ chat_id: chat.id, text: "✨ <b>URL Shortened Successfully!</b>\n\n" + "🔗 <b>Short Link:</b>\n" + "<code>" + res.content + "</code>\n\n" + "🚀 Powered by <b>TinyURL</b>", parse_mode: "HTML" }) Powered by Tinyurl 🚀 Getting Started is Simple!  1️⃣ Sign up / Log in at https://telebothost.com/  2️⃣ Add your first bot – don’t forget to read the guide 3️⃣ Paste the codes and begin your adventure Share your bot and codes with us to be part of our journey 🤝 Don’t forget to share this with your friends
8 · 841 ·
T
TBL Codes
Photo
click to show
🚀 Host Your Telegram Bot 24×7 for FREE (No VPS Needed!) Still paying for VPS or struggling to keep your Telegram bot online? Stop wasting money. In this video, I show step-by-step how to host a Telegram bot completely FREE with 24×7 uptime. ✅ Free hosting platform ✅ Bot runs 24×7 ✅ No VPS, no server tension ✅ Beginner-friendly 🎥 Watch now: https://www.youtube.com/results?search_query=Host+Telegram+Bot+24%2F7+for+FREE+%7C+No+VPS (Check thumbnail) If you’re serious about Telegram bot development, this one is non-negotiable. — Join the community for more real, practical Telegram bot tutorials 👇 🔗 https://t.me/codingwithmohit05/4
6 · 723 ·
T
TBL Codes
Photo
click to show
Our TBL Helper AI has crossed 300+ conversations 🎉  on ChatGPT store Try it and build your bots on telebothost.com - https://chatgpt.com/g/g-690a0a4ffde4819193a77612b76d05e5-tbl-helper-ai It is an AI assistant designed specially for: • Telegram Bot Development  • TeleBot Lang (TBL)  • Automation & Bot Logic  More updates, features & tools coming soon. #Telegram #TelegramBots #ChatGPT #Programming #Developers
7 · 852 ·
TBL Codes
❔ Code to get premium/custom emoji ids: 📘 Command: /emojiid// /emojiid command handler if (!params) { Api.sendMessage({ text: "❗ <b>Usage</b>:\n<code>/emojiid &lt;message with premium emoji&gt;</code>", parse_mode: "HTML" }); return; } let text = "❌ No premium/custom emojis found."; // Check entities if (request.entities && Array.isArray(request.entities)) { let ids = []; for (const entity of request.entities) { if ( entity.type === "custom_emoji" && entity.custom_emoji_id ) { ids.push(entity.custom_emoji_id); } } if (ids.length > 0) { text = "🆔 <b>Premium Emoji IDs</b>:\n\n"; ids.forEach(id => { text += `<tg-emoji emoji-id="${id}"></tg-emoji> <code>${id}</code>\n`; }); text += "\n📌 <b>Usage</b>:\n"; text += "<b>HTML:</b>\n"; text += `<code>&lt;tg-emoji emoji-id="EMOJI_ID"&gt;&lt;/tg-emoji&gt;</code>\n\n`; text += "<b>MarkdownV2:</b>\n"; text += `<code>![emoji](tg://emoji?id=EMOJI_ID)</code>`; } } Api.sendMessage({ text: text, parse_mode: "HTML" }); 🧑‍💻 Coded by @devendra ©️ Copyright @BjsCodes
5 · 759 ·
T
Custom emoji formatter Automatically detects Telegram custom emojis in user messages and converts them into safe tg://emoji?id= references, wrapped in code format. Works with any text length and preserves original messages. Like @AdsMarkdownBot Code : /** command: * need_reply: false */ if (!msg || !msg.text) return; if(chat.type != "private") return; function escapeHTML(t) { return t .replace(/&/g, "&amp;") .replace(/</g, "&lt;") .replace(/>/g, "&gt;"); } let text = msg.text; let entities = msg.entities || []; let result = ""; let lastIndex = 0; let hasCustomEmoji = false; for (let i = 0; i < entities.length; i++) { let e = entities[i]; if (e.type == "custom_emoji") { hasCustomEmoji = true; result += text.slice(lastIndex, e.offset); let emojiChar = text.substr(e.offset, e.length); result += "![" + emojiChar + "](tg://emoji?id=" + e.custom_emoji_id + ")"; lastIndex = e.offset + e.length; } } result += text.slice(lastIndex); let out = hasCustomEmoji ? result : text; out = escapeHTML(out); out = "<code>" + out + "</code>"; let max = 3800; for (let i = 0; i < out.length; i += max) { Api.sendMessage({ chat_id: chat.id, text: out.slice(i, i + max), parse_mode: "HTML" }); } 🚀 Getting Started is Simple!  1️⃣ Sign up / Log in at https://telebothost.com/  2️⃣ Add your first bot – don’t forget to read the guide 3️⃣ Paste the codes and begin your adventure Share your bot and codes with us to be part of our journey 🤝 Don’t forget to share this with your friends
3 · 955 ·
T
TBL Codes
// custom emoji ID const EMOJI_ID = "5474667187258006816" Api.sendMessage({   text: "<b>🔥 New Button UI</b>\n\nInline + Keyboard colors & icons",   parse_mode: "HTML",   reply_markup: {     inline_keyboard: [       // Row 1       [         { text: "Normal", callback_data: "*" },         { text: "Primary", callback_data: "*", style: "primary" }       ],       // Row 2       [         { text: "Success", callback_data: "*", style: "success" },         { text: "Danger", callback_data: "*", style: "danger" }       ],       // Row 3 (Icon)       [         {           text: "Icon Button",           callback_data: "*",           icon_custom_emoji_id: EMOJI_ID         }       ]     ]   } }) // ---------- KEYBOARD ---------- Api.sendMessage({   chat_id: chat.id,   text: "⌨️ Keyboard Button Test",   reply_markup: {     keyboard: [       [         { text: "Normal KB" },         { text: "Primary KB", style: "primary" }       ],       [         { text: "Success KB", style: "success" },         { text: "Danger KB", style: "danger" }       ],       [         {           text: "Icon KB",           icon_custom_emoji_id: EMOJI_ID         }       ]     ],     resize_keyboard: true   } }) Exclusive TBH (TBL) Code To Send Colored Button & Emoji Icon Button By @Paradox0x0 Note: Custom icon only works if bot owner has telegram premium
18 · 1K ·
T
TBL Codes
Photo
click to show
🧠 Smart Telegram Auto Caption Bot for TeleBotHost (TBH) Command: * TBL Code: function escapeHTML(text){ if(!text) return ""; return text .replace(/&/g, "&amp;") .replace(/</g, "&lt;") .replace(/>/g, "&gt;"); } let post = request; if(!post || !post.message_id) return; if(post.chat.type !== "channel") return; let footer = "\n\n━━━━━━━━━━━━━━\n" + "📢 <b>Follow us for more updates!</b>\n" + "🔗 <a href='https://t.me/bizft'>Join our channel</a>"; let checkText = (post.caption || post.text || ""); if(checkText.includes("Join our channel")) return; if(post.photo || post.video || post.document || post.audio){ let baseCaption = escapeHTML(post.caption ? post.caption.trim() : ""); let finalCaption = baseCaption ? (baseCaption + footer) : footer.trim(); if(finalCaption.length > 1024){ finalCaption = finalCaption.substring(0, 900) + "..." + footer; } Api.editMessageCaption({ chat_id: post.chat.id, message_id: post.message_id, caption: finalCaption, parse_mode: "HTML" }); return; } if(post.text){ let baseText = escapeHTML(post.text.trim()); let finalText = baseText + footer; Api.editMessageText({ chat_id: post.chat.id, message_id: post.message_id, text: finalText, parse_mode: "HTML", disable_web_page_preview: true }); return; } Setup Guide: 1️⃣ Create Your Bot: · Go to telebothost.com and create your bot 2️⃣ Add Command: · Create a new command * (wildcard) · Paste the above code into the command 3️⃣ Deploy & Test: · Deploy your bot · Send your chosen command to get a random quiz! ✅ 🧠Made BY @bizft
12 · 1K ·
T
TBL Codes
let res = await HTTP.get( "https://telebothost.com/logo.png", { headers: { "x-response-type": "buffer" } } ); const buffer = res.data; Api.setChatPhoto({ //chat_id: "id" , //default is current chat photo: buffer, }); This is how you can set Profile photo of a group with TBL And the same way you can use this trick on any method that need inputFile
5 · 1.1K ·
T
TBL Codes
Reply👋 Admin Contact Bot Codes For TeleBotHost command : @ TBL Code : let ADMINID = 5723455420; command : /start TBL Code : Api.sendMessage({ chat_id: chat.id, text: `👋 Hello *${user.first_name}*! I'm here to help you connect with the *Admin*. ━━━━━━━━━━━━━━━ 📌 *How it works:* 1️⃣ Send
//Use the all event Lister commnad * const ADMIN_ID = 5723455420; function getOriginalUserIdByMessageId(messageId) { let hiddenUserId = Bot.get("pvt" + messageId); return hiddenUserId; } if(!msg) return; if(chat.type != "private") return; // to ensure that it's a message update and private chat //forward any message from user to admin if(chat.id != ADMIN_ID) { let forwardResult = await Api.forwardMessage({ chat_id: ADMIN_ID, from_chat_id: chat.id, message_id: msg.message_id //msg is update.message }); if(forwardResult?.result?.forward_origin?.type == "hidden_user") { // Logic: When user has privacy mode enabled (hidden_user), // store mapping between forwarded message ID and original user ID // This allows admin to reply to hidden users by referencing the stored ID Bot.set("pvt" + forwardResult?.result?.message_id, user.id); } msg.reply("*✅ Message successfully sent to Admin*"); } if(chat.id == ADMIN_ID && request?.reply_to_message) { // if admin reply to forwarded message, send copy to user let originalChatId = request.reply_to_message?.forward_from?.id || getOriginalUserIdByMessageId(request.reply_to_message.message_id); Api.copyMessage({ chat_id: originalChatId, from_chat_id: ADMIN_ID, message_id: msg.message_id }); } Updated, Added fallback logic to handle hidden_user (forward messages show disable)
2 · 1.1K ·
T
TBL Codes
Pinterest Image Search TBL Code Api - https://pinterest-api-bay.vercel.app/example/docs Command - /search Wait for answer: On ✅ TBL - let query = message if (!query) { Bot.sendMessage("Please enter a search query.") return } User.set("q", query, "string") let res = await HTTP.post({ url: "https://pinterest-api-bay.vercel.app/v5/pins/search", body: { query: query, count: 10, compact: true } }) if (!res.ok) { Bot.sendMessage("Request failed. Please try again later.") return } let data try { data = res.data } catch (e) { Bot.sendMessage("Failed to parse response.") return } if (!data.items || data.items.length === 0) { Bot.sendMessage("No results found.") return } let savedQuery = User.get("q") || "Result" let botName = bot.name for (let i = 0; i < data.items.length; i++) { let item = data.items[i] let title = item.title ? item.title : savedQuery let image = item.image let link = item.url ? item.url : "" let buttons = [] if (link) { buttons.push([{ text: "View on Pinterest", url: link }]) } buttons.push([{ text: "Copy Image URL", copy_text: { text: image } }]) let caption = "<b>" + title + "</b>\n" + "<i>Query:</i> " + savedQuery + "\n" + "<i>Searched by:</i> @" + botName await Api.sendPhoto({ chat_id: user.telegramid, photo: image, caption: caption, parse_mode: "HTML", disable_web_page_preview: true, reply_markup: { inline_keyboard: buttons } }) } Developer: @CyberXCoding platform: telebothost.com
7 · 636 ·
T
TBL Codes
/* Command: * */ if(!update.guest_message){ return } let guest = update.guest_message let text = (guest.text || "").toLowerCase() let target = guest.from let message = "@Durov" // !info trigger if(text.includes("!info")){ // replied user info if(guest.reply_to_message){ let replied = guest.reply_to_message if(replied.guest_bot_caller_user){ target = replied.guest_bot_caller_user }else if(replied.from){ target = replied.from } } let name = target.first_name || "—" let username = target.username ? "@" + target.username : "—" let userid = target.id || "—" message = `👤 ${name} 🆔 ${userid} 🔗 ${username}` } // guest reply Api.call("answerGuestQuery", { guest_query_id: guest.guest_query_id, result: { type: "article", id: "reply", title: "Reply", description: "@Durov", input_message_content: { message_text: message } } }) 🔥 Tbl guest mode example code. Use query !info to get your or others info.
2 · 659 ·
T
TBL Codes
Groq Ai TBL Code Example of using Groq ai models in TBH Command: * TBL Code: const GROQ_API_KEY = "Api_Key" const MODEL = "llama-3.1-8b-instant" const TOKEN = bot.token async function editInline(id, text) { return await HTTP.post({ url: "https://api.telegram.org/bot" + TOKEN + "/editMessageText", body: { inline_message_id: id, text: text } }) } if (update.chosen_inline_result) { try { let query = update.chosen_inline_result.query let inlineMessageId = update.chosen_inline_result.inline_message_id if (!query || !inlineMessageId) return await editInline( inlineMessageId, "Thinking..." ) let ai = await HTTP.post({ url: "https://api.groq.com/openai/v1/chat/completions", headers: { Authorization: "Bearer " + GROQ_API_KEY }, body: { model: MODEL, messages: [ { role: "user", content: query } ] } }) let reply = ai.data.choices[0].message.content await editInline( inlineMessageId, reply || "No response" ) } catch (e) { await editInline( update.chosen_inline_result .inline_message_id, "API Error" ) } } Command: /inline_query TBL Code: try { let query = request.query if (!query || query.trim() === "") { return await Api.answerInlineQuery({ inline_query_id: request.id, results: [], cache_time: 1 }) } query = query.slice(0, 256) await Api.answerInlineQuery({ inline_query_id: request.id, cache_time: 1, is_personal: true, results: [ { type: "article", id: String(Date.now()), title: "Ask AI", description: query, input_message_content: { message_text: "Thinking... ▌" }, reply_markup: { inline_keyboard: [
6 · 756 ·
T
TBL Codes
Link
click to show
TBH Helper Ai was deleted on ChatGPT but don't worry we came with new TBH Helper Ai on Gemini - Try it and build your bots on telebothost.com - https://gemini.google.com/gem/1j_DmyTdxpxuBgtEJBOLVcCGumvVw5XmM?usp=sharing TBH Helper Ai is a Expert: • TeleBot Lang (TBL)  • trained on TBH Docs docs.telebothost.com More updates, features & tools coming soon. it may do soe mistakes so give feedback so we can improve and do fixes #Telegram #TelegramBots #ChatGPT #Programming #Developers
5 · 756 ·
T
TBL Codes
File
bot_1139149302.zip · 3 KB · click to show
Official broadcast codes
5 · 477 ·
T
TBL Codes
Photo
click to show
Demo TBH code for the new Bot API update ephemeral message. Code: /* Command: /ephemeral */ // Get target user and chat info let targetUserId = user.id; let groupId = chat.id; let userName = user.first_name || "User"; // 1. Send Ephemeral Text Message await Api.sendMessage({ chat_id: groupId, text: "🎯 This message is only visible to you, " + userName + "!", receiver_user_id: targetUserId, parse_mode: "HTML" }); // 2. Send Ephemeral Photo await Api.sendPhoto({ chat_id: groupId, photo: "https://telegram.org/img/t_logo.png", caption: "📸 <b>Private Photo</b>\n\nOnly you can see this!", receiver_user_id: targetUserId, parse_mode: "HTML" }); // 3. Send Ephemeral Sticker await Api.sendSticker({ chat_id: groupId, sticker: "CAACAgIAAxkBAAIxM2pbn6j6YZCWRUsSdh6sen7nBmJbAAL8HgACuNHQSheZ4BUjnIebPQQ", receiver_user_id: targetUserId }); For more explore new update!
3 · 439 ·
T
TBL Codes
Demo TBH code to get user info with profile pic (Guest Message + Rich Message. Code: // Command: * or /handle_guest_message if (!update.guest_message) return let msg = update.guest_message let userText = msg.text || "" if (!msg.text) return // User info from global `user` object let fullName = user.full_name || user.first_name || "User" let userId = user.id || "Unknown" let username = user.username ? "@" + user.username : "Not set" let language = user.language_code || "Unknown" let isBot = user.is_bot ? "Yes" : "No" let isPremium = user.is_premium ? "✅ Yes" : "❌ No" // Fetch profile photos let photoFileIds = [] let mediaItems = [] let photoHtml = "" try { let photos = await Api.getUserProfilePhotos({ user_id: userId, limit: 50 }) if (photos.ok && photos.result && photos.result.photos && photos.result.photos.length > 0) { let allPhotos = photos.result.photos let maxPhotos = Math.min(allPhotos.length, 50) for (let i = 0; i < maxPhotos; i++) { let photo = allPhotos[i] if (photo && photo.length > 0) { let fileId = photo[photo.length - 1].file_id let mediaId = "photo_" + i photoFileIds.push(fileId) mediaItems.push({ id: mediaId, media: { type: "photo", media: fileId } }) } } if (photoFileIds.length > 0) { let slideshowImages = photoFileIds.map(function(id, index) { return '<img src="tg://photo?id=photo_' + index + '"/>' }).join('\n ') let captionText = photoFileIds.length === 1 ? "📸 1 profile photo" : "📸 " + photoFileIds.length + " profile photos" photoHtml = ` <tg-slideshow> ${slideshowImages} <figcaption>${captionText}</figcaption> </tg-slideshow> ` } } } catch (e) { photoHtml = `<p><i>Could not fetch profile photos</i></p>` } if (!photoFileIds.length) { photoHtml = `<p><i>No profile photos found</i></p>` } // Build
6 · 399 ·

An open public feed from the search index ChatCrawler — “Google for public Telegram”; refreshed as the venue is crawled. Times are UTC.

Public content only, official Telegram API. About · FAQ · What we do not do · Remove a page · Catalog · Search · How we count