soumyadeepdas/TbhRichBotPublic · Community Store Listing
Rich Message Demo [TBH]
17 commands0 envUpdated 5d agoCreated Jul 16, 2026
commands/_richMedia.js
javascript · 150 lines · click line # to share
1/**#command2name: /richMedia3answer: 4keyboard: 5parse_mode: 6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12const photo1 = "https://image.zaw-myo.workers.dev/image/6c6c9eb5-2210-4736-b91e-e59344dd1be1";13const photo2 = "https://image.zaw-myo.workers.dev/image/d497582c-c5ab-47a1-8f91-56f34df7aa65";14const photo3 = "https://image.zaw-myo.workers.dev/image/f4e58160-eac9-4604-831b-053d91b402a4";15const video1 = "https://www.w3schools.com/html/mov_bbb.mp4";16const animation1 = "https://media.giphy.com/media/ICOgUNjpvO0PC/giphy.gif";17const audio1 = "https://www.learningcontainer.com/wp-content/uploads/2020/02/Kalimba.mp3";18const voice1 = "https://www.w3schools.com/html/horse.mp3";19 20const html = `21<h1>Media Blocks</h1>22 23<p>This page demonstrates media blocks introduced in Bot API 10.1.</p>24 25<hr/>26 27<h3>Image</h3>28<figure>29 <img src="${photo1}"/>30 <figcaption>Basic Image Example</figcaption>31</figure>32 33<hr/>34 35<h3>Image With Credit</h3>36<figure>37 <img src="${photo2}"/>38 <figcaption>Image Caption<cite>Photo Credit</cite></figcaption>39</figure>40 41<hr/>42 43<h3>Spoiler Image</h3>44<figure>45 <img src="${photo3}" tg-spoiler/>46 <figcaption>Spoiler Protected Image</figcaption>47</figure>48 49<hr/>50 51<h3>Video</h3>52<figure>53 <video src="${video1}"></video>54 <figcaption>Video Example</figcaption>55</figure>56 57<hr/>58 59<h3>Spoiler Video</h3>60<figure>61 <video src="${video1}" tg-spoiler></video>62 <figcaption>Spoiler Video Example</figcaption>63</figure>64 65<hr/>66 67<h3>Animation</h3>68<figure>69 <video src="${animation1}"></video>70 <figcaption>Animation / GIF Example</figcaption>71</figure>72 73<hr/>74 75<h3>Audio</h3>76<figure>77 <audio src="${audio1}"></audio>78 <figcaption>Audio Example</figcaption>79</figure>80 81<hr/>82 83<h3>Voice Note</h3>84<figure>85 <audio src="${voice1}"></audio>86 <figcaption>Voice Note Example</figcaption>87</figure>88 89<hr/>90 91<h3>Map</h3>92<figure>93 <tg-map lat="48.858370" long="2.294481" zoom="16"/>94 <figcaption>Eiffel Tower, Paris</figcaption>95</figure>96 97<hr/>98 99<h3>Collage</h3>100<tg-collage>101 <img src="${photo1}"/>102 <img src="${photo2}"/>103 <video src="${video1}"></video>104 <figcaption>Collage Example</figcaption>105</tg-collage>106 107<hr/>108 109<h3>Slideshow</h3>110<tg-slideshow>111 <img src="${photo1}"/>112 <img src="${photo2}"/>113 <video src="${video1}"></video>114 <figcaption>Slideshow Example</figcaption>115</tg-slideshow>116 117<hr/>118 119<h3>Mixed Media Showcase</h3>120<p>Rich Messages can combine different media types in a single document.</p>121 122<tg-collage>123 <img src="${photo1}"/>124 <img src="${photo2}"/>125 <figcaption>Mixed Media Preview</figcaption>126</tg-collage>127 128<figure>129 <video src="${video1}"></video>130 <figcaption>Video Below Collage</figcaption>131</figure>132 133<footer>Bot API 10.1 • Media Blocks Demo</footer>134`;135 136Api.call("editMessageText", {137 chat_id: chat.chatid,138 message_id: update.callback_query.message.message_id,139 rich_message: { html: html },140 reply_markup: {141 inline_keyboard: [142 [143 { text: "« Details", callback_data: "/richDetails" },144 { text: "Home", callback_data: "/start" },145 { text: "Code »", callback_data: "/richCode" }146 ]147 ]148 }149});150