soumyadeep/TgDocsXBotPublic · Bot Template

TgDocsXBot is a Telegram bot template designed to help developers instantly look up Telegram Bot API documentation directly inside any chat using Inline Queries.

ProfileTelegram
7 commands3 envUpdated 5d agoCreated Jun 10, 2026
Back to folder

commands/_start.js

javascript · 69 lines · click line # to share

1/**#command2name: /start3answer: 4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12let text = `<b>Welcome to the Telegram Bot API Docs!</b>13 14I help you search the <b>Telegram Bot API documentation</b> instantly — right from any chat, no copy-pasting required.15 16<b>How to use me:</b>17🔎 Type <code>@${bot.name} methodName</code> to look up a method18🧩 Search a property too: <code>@${bot.name} method.field</code>19 20<b>Examples:</b>21• <code>@${bot.name} sendMessage</code>22• <code>@${bot.name} Message.chat</code>23 24Tap a button below to get started 👇`;25 26if(params){27  if (params == "examples") {28    Bot.runCommand("/examples")29    return;30  }31  if(params == "details"){32    Bot.runCommand("/details")33  }34}35 36const inlineKeyboard = {37  inline_keyboard: [38    [{39        text: "Details",40        callback_data: "/details"41      },42      {43        text: "Examples",44        callback_data: "/examples"45      }46    ],47    [{48      text: "Search here",49      switch_inline_query_current_chat: ""50    }],51    [{52      text: "Search in another chat",53      switch_inline_query: ""54    }]55  ]56};57if (request.data) {58  Api.editMessageText({59    message_id: request.message.message_id,60    text,61    parse_mode: "html",62    reply_markup: inlineKeyboard63  })64} else {65  msg.reply(text, {66    parse_mode: "HTML",67    reply_markup: inlineKeyboard68  });69}