Hey! It’s under maintenance right now, coming soon!

How to create Website Screenshot Generator Telegram Bot.

Please wait 0 seconds...
Scroll Down and click on Go to Link for destination
Congrats! Link is Generated

Hello! Welcome to CodeNest.

If you want to How to create Website Screenshot Generator Telegram Bot then this post is just for you.

How to create Website Screenshot Generator Telegram Bot

Taking website screenshots has never been easier! With this simple and professional Telegram Website Screenshot Generator Bot, you just need to send any website URL, and the bot will instantly capture a high-quality screenshot of the page and send it back to you all within seconds!

What is a Telegram Website Screenshot Generator Bot?

A Telegram Website Screenshot Generator Bot is an automated tool integrated into the Telegram platform that allows users to capture full-page screenshots of any website simply by sending a URL. The bot fetches the live page, takes a screenshot in real time using an API (like ScreenshotMachine), and sends the image back to the user in seconds.

How It Works

The bot takes a website URL from the user, sends it to a screenshot API like screenshotmachine.com, and returns a full-page screenshot image all in real time through Telegram.

You can see the demo⤵

View Demo

Features

  1. Fast and real-time screenshot generation
  2. Supports Desktop, Tablet, and Mobile views
  3. Simple URL input via Telegram message
  4. Direct image download without opening browser
  5. Clean and user-friendly interaction

How to Use

  1. Open Telegram and search for your bot (or the provided bot username).
  2. Start the bot by clicking on the Start button.
  3. Send any website link (example: https://example.com).
  4. The bot will reply with a screenshot of that website.
  5. Tap and hold the image to download it or forward it.

Read the Documentation & Set Up the Bot.

Read the full documentation and set up your own Telegram bot. Below is the complete code for the Website Screenshot Generator Bot.

Bot Set-UP Documentation
const BOT_TOKEN = "#########";
const API_KEY = "######";

const devices = [
  { name: "🖥 Desktop", dimension: "1366x768" },
  { name: "📱 Phone", dimension: "375x667" },
  { name: "📲 Tablet", dimension: "768x1024" },
];

addEventListener("fetch", event => {
  event.respondWith(handleRequest(event.request));
});

async function handleRequest(request) {
  const { message, callback_query } = await request.json();

  // If callback button clicked
  if (callback_query) {
    const chatId = callback_query.message.chat.id;
    const name = callback_query.from.first_name || "there";
    const data = callback_query.data;

    if (data === "capture") {
      await sendMessage(BOT_TOKEN, chatId, `⚡ *${name}*, please send a website link (with https://) to capture.`, []);
    }

    return new Response("Callback handled");
  }

  // Regular message
  if (!message || !message.chat || !message.text) return new Response("Invalid");

  const chatId = message.chat.id;
  const text = message.text.trim();
  const name = message.from.first_name || "there";

  if (text === "/start") {
    await sendMessage(BOT_TOKEN, chatId, `Hey *${name}* welcome to *SiteSnap*

Just send me any website link (starting with https://) and I'll capture high-quality screenshots in *Desktop*, *Tablet*, and *Mobile* views—all in seconds!

*⚡ No sign-ups, no wait—just instant, high-quality previews with download options!*`, [
      [{ text: "📸 Capture Screenshot", callback_data: "capture" }]
    ]);
    return new Response("Started");
  }

  if (text === "/help") {
    await sendMessage(BOT_TOKEN, chatId, `⚙️ *How to Use SiteSnap Bot:*

1. Send a website link like \`https://example.com\`  
2. Wait while I *capture screenshots*  
3. You’ll get images for:  
   🖥 Desktop  
   📱 Phone  
   📲 Tablet  

_Simple, fast & no signup needed._`);
    return new Response("Help sent");
  }

  if (text === "/about") {
    await sendMessage(BOT_TOKEN, chatId, `ℹ️ *About SiteSnap Bot*

SiteSnap is a fast and simple Telegram bot to generate website screenshots for different screen sizes.

⭐ *Features:*
• Auto screenshots (Desktop, Phone, Tablet)  
• Instant previews + view buttons  
• Supports homepage, posts & internal pages  
• No signup needed

Created by @techankur12`);
    return new Response("About sent");
  }

  const urlRegex = /(https?:\/\/[^\s]+)/;
  const match = text.match(urlRegex);

  if (!match) {
    await sendMessage(BOT_TOKEN, chatId, "⚠️ No valid URL found. Please send a website link like:\n`https://example.com`");
    return new Response("Invalid URL");
  }

  const siteUrl = match[0];
  const encodedUrl = encodeURIComponent(siteUrl);
  const timestamp = Date.now();

  // Countdown Message
  let countdown = 5;
  const waitMsg = await sendMessage(BOT_TOKEN, chatId, `*⏳ Capturing screenshots Please wait ${countdown} seconds...*`);
  const waitMsgId = waitMsg.result.message_id;

  while (countdown > 1) {
    await new Promise(resolve => setTimeout(resolve, 1000));
    countdown--;
    await editMessage(BOT_TOKEN, chatId, waitMsgId, `*⏳ Capturing screenshots Please wait ${countdown} seconds...*`);
  }

  await new Promise(resolve => setTimeout(resolve, 1000));
  await deleteMessage(BOT_TOKEN, chatId, waitMsgId);

  // Send 3 screenshots
  for (const device of devices) {
    const imageUrl = `https://api.screenshotmachine.com/?key=${API_KEY}&url=${encodedUrl}&dimension=${device.dimension}&format=png&cacheLimit=${timestamp}`;
    await sendPhoto(BOT_TOKEN, chatId, imageUrl, [
      [{ text: `🔍 View ${device.name}`, url: imageUrl }]
    ]);
  }

  return new Response("Screenshots sent");
}

async function sendMessage(token, chatId, text, buttons = []) {
  const res = await fetch(`https://api.telegram.org/bot${token}/sendMessage`, {
    method: "POST",
    headers: { "Content-Type": "application/json" },
    body: JSON.stringify({
      chat_id: chatId,
      text,
      parse_mode: "Markdown",
      reply_markup: buttons.length ? { inline_keyboard: buttons } : undefined
    })
  });
  return res.json();
}

async function editMessage(token, chatId, messageId, newText) {
  return fetch(`https://api.telegram.org/bot${token}/editMessageText`, {
    method: "POST",
    headers: { "Content-Type": "application/json" },
    body: JSON.stringify({
      chat_id: chatId,
      message_id: messageId,
      text: newText,
      parse_mode: "Markdown"
    })
  });
}

async function deleteMessage(token, chatId, messageId) {
  return fetch(`https://api.telegram.org/bot${token}/deleteMessage`, {
    method: "POST",
    headers: { "Content-Type": "application/json" },
    body: JSON.stringify({
      chat_id: chatId,
      message_id: messageId
    })
  });
}

async function sendPhoto(token, chatId, photoUrl, buttons = []) {
  return fetch(`https://api.telegram.org/bot${token}/sendPhoto`, {
    method: "POST",
    headers: { "Content-Type": "application/json" },
    body: JSON.stringify({
      chat_id: chatId,
      photo: photoUrl,
      reply_markup: { inline_keyboard: buttons }
    })
  });
}

Watch this video for better guidance on setting up and using the bot.

Conclusion

The Telegram Website Screenshot Generator Bot is a powerful and time-saving tool for capturing high-quality website screenshots right from your chat. Whether you're a developer, designer, blogger, or just someone who needs quick previews of web pages this bot makes it fast, reliable, and incredibly easy. Try it out and simplify your workflow today!

About the Author

Hey! Im Ankur Kumar, I am a professional part time blogger. Here we share informative and technical information. This blog is made to teach you something new. Buy Me a Coffee

إرسال تعليق

Please don't share any sensitive or personal details here.
Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
Site is Blocked
Sorry! This site is not available in your country.