ShahriarAbidbd/SmartifyXBotPublic · Bot Template

Do Tasks Smartly with SmartifyX 😎

Utilitydownloaderyoutubeinstagramfacebookspoilercontent-protection
ProfileTelegram
25 commands2 envUpdated 1d agoCreated Jul 28, 2026
Back to folder

commands/_ss.js

javascript · 59 lines

Raw
1/**#command2name: /ss3answer: 4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12function addHTTP(link) {13  if (link.startsWith("http://") || link.startsWith("https://")) {14    return link;15  }16  return "http://" + link;17}18 19async function getLink(link) {20 21  let a = await Bot.sendMessage("*Checking URL...*")22  let mid = a.result.message_id23 24  if (!modules.validator.isURL(link)) {25    a.editText("*This isn't a valid url*")26    a.react("😢")27    return28  }29 30  await Api.editMessageText({31    chat_id: chat.id,32    message_id: mid,33    text: "*Generating Screenshot...*",34    parse_mode: "markdown"35  })36 37  await Api.editMessageText({38    chat_id: chat.id,39    message_id: mid,40    text: "*Sending...*",41    parse_mode: "markdown"42  })43 44  let ss = await Api.sendPhoto({45    photo: "https://api.microlink.io/?url=" + encodeURIComponent(addHTTP(link)) + "&screenshot=true&embed=screenshot.url"46  })47 48  //Bot.inspect(ss)49 50}51 52/* command handler */53if (request.reply_to_message && request.reply_to_message.text) {54  getLink(request.reply_to_message.text)55} else if (params) {56  getLink(params)57} else {58  msg.reply("❗ Please provide a valid Link")59}