soumyadeepdas/TbhRichBotPublic · Community Store Listing

Rich Message Demo [TBH]

ProfileTelegram
17 commands0 envUpdated 5d agoCreated Jul 16, 2026
Back to folder

commands/_richDetails.js

javascript · 172 lines · click line # to share

1/**#command2name: /richDetails3answer: 4keyboard: 5parse_mode: 6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12const html =13  "<h1>Details Blocks</h1>" +14  "<p>This page demonstrates advanced Details blocks introduced in Bot API 10.1.</p>" +15  "<hr/>" +16  "<h3>Basic Details</h3>" +17  "<details>" +18  "<summary>Closed Details Block</summary>" +19  "<p>" +20  "This content is hidden until expanded by the user." +21  "</p>" +22  "</details>" +23  "<details open>" +24  "<summary>Open Details Block</summary>" +25  "<p>" +26  "This details block is expanded by default." +27  "</p>" +28  "</details>" +29  "<hr/>" +30  "<h3>Nested Details</h3>" +31  "<details>" +32  "<summary>Level 1</summary>" +33  "<p>Parent Content</p>" +34  "<details>" +35  "<summary>Level 2</summary>" +36  "<p>Child Content</p>" +37  "</details>" +38  "</details>" +39  "<hr/>" +40  "<h3>Deep Nested Details</h3>" +41  "<details>" +42  "<summary>Level 1</summary>" +43  "<details>" +44  "<summary>Level 2</summary>" +45  "<details>" +46  "<summary>Level 3</summary>" +47  "<details>" +48  "<summary>Level 4</summary>" +49  "<p>" +50  "You reached the deepest nested details example." +51  "</p>" +52  "</details>" +53  "</details>" +54  "</details>" +55  "</details>" +56  "<hr/>" +57  "<h3>Details With Lists</h3>" +58  "<details>" +59  "<summary>Show List Example</summary>" +60  "<ul>" +61  "<li>First Item</li>" +62  "<li>Second Item</li>" +63  "<li>Third Item</li>" +64  "</ul>" +65  "</details>" +66  "<hr/>" +67  "<h3>Details With Quote</h3>" +68  "<details>" +69  "<summary>Show Quote Example</summary>" +70  "<blockquote>" +71  "The best way to predict the future is to invent it." +72  "<cite>Alan Kay</cite>" +73  "</blockquote>" +74  "</details>" +75  "<hr/>" +76  "<h3>Details With Table</h3>" +77  "<details>" +78  "<summary>Show Table Example</summary>" +79  "<table bordered>" +80  "<tr>" +81  "<th>Name</th>" +82  "<th>Role</th>" +83  "</tr>" +84  "<tr>" +85  "<td>Alice</td>" +86  "<td>Developer</td>" +87  "</tr>" +88  "<tr>" +89  "<td>Bob</td>" +90  "<td>Designer</td>" +91  "</tr>" +92  "</table>" +93  "</details>" +94  "<hr/>" +95  "<h3>Details With Math</h3>" +96  "<details>" +97  "<summary>Show Math Example</summary>" +98  "<tg-math-block>" +99  "x=\\frac{-b\\pm\\sqrt{b^2-4ac}}{2a}" +100  "</tg-math-block>" +101  "</details>" +102  "<hr/>" +103  "<h3>Details With References</h3>" +104  "<details>" +105  "<summary>Show Reference Example</summary>" +106  "<p>" +107  "This statement contains a reference " +108  "<a href='#detailref1'>[1]</a>" +109  "</p>" +110  "<tg-reference name='detailref1'>" +111  "Example reference stored inside a details block." +112  "</tg-reference>" +113  "</details>" +114  "<hr/>" +115  "<h3>FAQ Example</h3>" +116  "<details>" +117  "<summary>What are Rich Messages?</summary>" +118  "<p>" +119  "Rich Messages are structured Telegram documents introduced in Bot API 10.1." +120  "</p>" +121  "</details>" +122  "<details>" +123  "<summary>Do Rich Messages support tables?</summary>" +124  "<p>" +125  "Yes. They support advanced tables with captions, alignment, rowspan and colspan." +126  "</p>" +127  "</details>" +128  "<details>" +129  "<summary>Can Rich Messages contain media?</summary>" +130  "<p>" +131  "Yes. Photos, videos, audio, maps, collages and slideshows are supported." +132  "</p>" +133  "</details>" +134  "<hr/>" +135  "<h3>Documentation Layout Example</h3>" +136  "<details>" +137  "<summary>Installation</summary>" +138  "<p>" +139  "Step-by-step installation instructions." +140  "</p>" +141  "</details>" +142  "<details>" +143  "<summary>Configuration</summary>" +144  "<p>" +145  "Configuration examples and settings." +146  "</p>" +147  "</details>" +148  "<details>" +149  "<summary>API Reference</summary>" +150  "<p>" +151  "Method documentation and object schemas." +152  "</p>" +153  "</details>" +154  "<footer>" +155  "Bot API 10.1 • Details Blocks Demo" +156  "</footer>";157 158Api.call("editMessageText", {159  chat_id: chat.chatid,160  message_id: update.callback_query.message.message_id,161  rich_message: { html: html },162  reply_markup: {163    inline_keyboard: [164      [165        { text: "« Tables", callback_data: "/richTables" },166        { text: "Home", callback_data: "/start" },167        { text: "Media »", callback_data: "/richMedia" }168      ]169    ]170  }171});172