{"id":424,"date":"2024-09-05T17:20:01","date_gmt":"2024-09-05T09:20:01","guid":{"rendered":"https:\/\/blog.laning.org\/?p=424"},"modified":"2025-03-29T17:19:21","modified_gmt":"2025-03-29T09:19:21","slug":"%e5%9f%ba%e4%ba%8ecloudflare-worker%e7%9a%84telegram%e4%bc%a0%e4%bf%a1%e6%9c%ba%e5%99%a8%e4%ba%ba","status":"publish","type":"post","link":"https:\/\/blog.laning.org\/index.php\/2024\/09\/05\/424\/","title":{"rendered":"\u57fa\u4e8eCloudflare Worker\u7684Telegram\u4f20\u4fe1\u673a\u5668\u4eba"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">\u9879\u76ee\u539f\u56e0<\/h2>\n\n\n\n<p>Telegram\u662f\u5f88\u6ce8\u91cd\u9690\u79c1\u7684\u804a\u5929\u8f6f\u4ef6\uff0c\u53d7\u5230\u5f88\u591a\u4eba\u7684\u9752\u7750\u3002\u4f46\u662f\uff0c\u5982\u679c\u7ecf\u5e38\u548c\u964c\u751f\u4eba\u804a\u5929\u5f88\u5bb9\u6613\u89e6\u53d1\u98ce\u63a7\uff0c\u56e0\u6b64\u4e00\u6b3e\u597d\u7528\u7684\u4f20\u4fe1\u673a\u5668\u4eba\u5341\u5206\u6709\u5fc5\u8981\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u9879\u76ee\u7279\u8272<\/h2>\n\n\n\n<ul>\n<li>\u5728nfdv1\u9879\u76ee\u7684\u57fa\u7840\u4e0a\u589e\u52a0\u63d0\u793a\u5bf9\u65b9ID\uff08TG\u8d26\u6237\u552f\u4e00\u6807\u8bc6\uff09<\/li>\n\n\n\n<li>\u7f8e\u5316\u8f93\u51faUI\uff0c\u4ee5\u53ca\u5c01\u7981\u903b\u8f91<\/li>\n\n\n\n<li>\u652f\u6301\u6784\u5efa\u6b3a\u8bc8\u6570\u636e\u5e93\uff0c\u6709\u4e0d\u826f\u8bb0\u5f55\u7684\u7528\u6237\u53ca\u65f6\u63d0\u9192<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">\u90e8\u7f72\u65b9\u6cd5<\/h2>\n\n\n\n<ol>\n<li>\u4ece<a href=\"https:\/\/t.me\/BotFather\">@BotFather<\/a>\u83b7\u53d6token\uff0c\u5e76\u4e14\u53ef\u4ee5\u53d1\u9001<code>\/setjoingroups<\/code>\u6765\u7981\u6b62\u6b64Bot\u88ab\u6dfb\u52a0\u5230\u7fa4\u7ec4<\/li>\n\n\n\n<li>\u4ece<a href=\"https:\/\/www.uuidgenerator.net\/\">uuidgenerator<\/a>\u83b7\u53d6\u4e00\u4e2a\u968f\u673auuid\u4f5c\u4e3asecret<\/li>\n\n\n\n<li>\u4ece<a href=\"https:\/\/t.me\/username_to_id_bot\">@username_to_id_bot<\/a>\u83b7\u53d6\u4f60\u7684\u7528\u6237id<\/li>\n\n\n\n<li>\u767b\u5f55<a href=\"https:\/\/workers.cloudflare.com\/\">cloudflare<\/a>\uff0c\u521b\u5efa\u4e00\u4e2aworker<\/li>\n\n\n\n<li>\u914d\u7f6eworker\u7684\u53d8\u91cf\n<ul>\n<li>\u589e\u52a0\u4e00\u4e2a<code>ENV_BOT_TOKEN<\/code>\u53d8\u91cf\uff0c\u6570\u503c\u4e3a\u4ece\u6b65\u9aa41\u4e2d\u83b7\u5f97\u7684token<\/li>\n\n\n\n<li>\u589e\u52a0\u4e00\u4e2a<code>ENV_BOT_SECRET<\/code>\u53d8\u91cf\uff0c\u6570\u503c\u4e3a\u4ece\u6b65\u9aa42\u4e2d\u83b7\u5f97\u7684secret<\/li>\n\n\n\n<li>\u589e\u52a0\u4e00\u4e2a<code>ENV_ADMIN_UID<\/code>\u53d8\u91cf\uff0c\u6570\u503c\u4e3a\u4ece\u6b65\u9aa43\u4e2d\u83b7\u5f97\u7684\u7528\u6237id<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>\u7ed1\u5b9akv\u6570\u636e\u5e93\uff0c\u521b\u5efa\u4e00\u4e2aNamespace Name\u4e3a<code>nfd<\/code>\u7684kv\u6570\u636e\u5e93\uff0c\u5728setting -&gt; variable\u4e2d\u8bbe\u7f6e<code>KV Namespace Bindings<\/code>\uff1anfd -&gt; nfd<\/li>\n\n\n\n<li>\u70b9\u51fb<code>Quick Edit<\/code>\uff0c\u590d\u5236<a href=\"worker.js\">\u8fd9\u4e2a\u6587\u4ef6<\/a>\u5230\u7f16\u8f91\u5668\u4e2d<\/li>\n\n\n\n<li>\u901a\u8fc7\u6253\u5f00<code>https:\/\/xxx.workers.dev\/registerWebhook<\/code>\u6765\u6ce8\u518cwebsoket<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">\u4f7f\u7528\u65b9\u6cd5<\/h2>\n\n\n\n<ul>\n<li>\u5f53\u5176\u4ed6\u7528\u6237\u7ed9bot\u53d1\u6d88\u606f\uff0c\u4f1a\u88ab\u8f6c\u53d1\u5230bot\u521b\u5efa\u8005<\/li>\n\n\n\n<li>\u7528\u6237\u56de\u590d\u666e\u901a\u6587\u5b57\u7ed9\u8f6c\u53d1\u7684\u6d88\u606f\u65f6\uff0c\u4f1a\u56de\u590d\u5230\u539f\u6d88\u606f\u53d1\u9001\u8005<\/li>\n\n\n\n<li>\u7528\u6237\u56de\u590d<code>\/block<\/code>, <code>\/unblock<\/code>, <code>\/checkblock<\/code>\u7b49\u547d\u4ee4\u4f1a\u6267\u884c\u76f8\u5173\u6307\u4ee4\uff0c<strong>\u4e0d\u4f1a<\/strong>\u56de\u590d\u5230\u539f\u6d88\u606f\u53d1\u9001\u8005<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u9879\u76ee\u539f\u56e0 Telegram\u662f\u5f88\u6ce8\u91cd\u9690\u79c1\u7684\u804a\u5929\u8f6f\u4ef6\uff0c\u53d7\u5230\u5f88\u591a\u4eba\u7684\u9752\u7750\u3002\u4f46\u662f\uff0c\u5982\u679c\u7ecf\u5e38\u548c\u964c\u751f\u4eba\u804a\u5929\u5f88\u5bb9\u6613\u89e6\u53d1\u98ce\u63a7\uff0c [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v17.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u57fa\u4e8eCloudflare Worker\u7684Telegram\u4f20\u4fe1\u673a\u5668\u4eba &ndash; Laning &#039;s Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/blog.laning.org\/index.php\/2024\/09\/05\/424\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u57fa\u4e8eCloudflare Worker\u7684Telegram\u4f20\u4fe1\u673a\u5668\u4eba &ndash; Laning &#039;s Blog\" \/>\n<meta property=\"og:description\" content=\"\u9879\u76ee\u539f\u56e0 Telegram\u662f\u5f88\u6ce8\u91cd\u9690\u79c1\u7684\u804a\u5929\u8f6f\u4ef6\uff0c\u53d7\u5230\u5f88\u591a\u4eba\u7684\u9752\u7750\u3002\u4f46\u662f\uff0c\u5982\u679c\u7ecf\u5e38\u548c\u964c\u751f\u4eba\u804a\u5929\u5f88\u5bb9\u6613\u89e6\u53d1\u98ce\u63a7\uff0c [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/blog.laning.org\/index.php\/2024\/09\/05\/424\/\" \/>\n<meta property=\"og:site_name\" content=\"Laning &#039;s Blog\" \/>\n<meta property=\"article:published_time\" content=\"2024-09-05T09:20:01+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-03-29T09:19:21+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"laning\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/blog.laning.org\/#website\",\"url\":\"https:\/\/blog.laning.org\/\",\"name\":\"\\u8fa3\\u5b81\\u7684\\u535a\\u5ba2\",\"description\":\"Learning on the go\",\"publisher\":{\"@id\":\"https:\/\/blog.laning.org\/#\/schema\/person\/040331b403ed00370f2fc1e8eb6e6b93\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/blog.laning.org\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-CN\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/blog.laning.org\/index.php\/2024\/09\/05\/424\/#webpage\",\"url\":\"https:\/\/blog.laning.org\/index.php\/2024\/09\/05\/424\/\",\"name\":\"\\u57fa\\u4e8eCloudflare Worker\\u7684Telegram\\u4f20\\u4fe1\\u673a\\u5668\\u4eba &ndash; Laning &#039;s Blog\",\"isPartOf\":{\"@id\":\"https:\/\/blog.laning.org\/#website\"},\"datePublished\":\"2024-09-05T09:20:01+00:00\",\"dateModified\":\"2025-03-29T09:19:21+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/blog.laning.org\/index.php\/2024\/09\/05\/424\/#breadcrumb\"},\"inLanguage\":\"zh-CN\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/blog.laning.org\/index.php\/2024\/09\/05\/424\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/blog.laning.org\/index.php\/2024\/09\/05\/424\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\\u9996\\u9875\",\"item\":\"https:\/\/blog.laning.org\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\\u57fa\\u4e8eCloudflare Worker\\u7684Telegram\\u4f20\\u4fe1\\u673a\\u5668\\u4eba\"}]},{\"@type\":\"Article\",\"@id\":\"https:\/\/blog.laning.org\/index.php\/2024\/09\/05\/424\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/blog.laning.org\/index.php\/2024\/09\/05\/424\/#webpage\"},\"author\":{\"@id\":\"https:\/\/blog.laning.org\/#\/schema\/person\/040331b403ed00370f2fc1e8eb6e6b93\"},\"headline\":\"\\u57fa\\u4e8eCloudflare Worker\\u7684Telegram\\u4f20\\u4fe1\\u673a\\u5668\\u4eba\",\"datePublished\":\"2024-09-05T09:20:01+00:00\",\"dateModified\":\"2025-03-29T09:19:21+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/blog.laning.org\/index.php\/2024\/09\/05\/424\/#webpage\"},\"wordCount\":40,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/blog.laning.org\/#\/schema\/person\/040331b403ed00370f2fc1e8eb6e6b93\"},\"articleSection\":[\"Github\"],\"inLanguage\":\"zh-CN\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/blog.laning.org\/index.php\/2024\/09\/05\/424\/#respond\"]}]},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/blog.laning.org\/#\/schema\/person\/040331b403ed00370f2fc1e8eb6e6b93\",\"name\":\"laning\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/blog.laning.org\/#personlogo\",\"inLanguage\":\"zh-CN\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/17215f328425d53537532588320693a1?s=96&d=retro&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/17215f328425d53537532588320693a1?s=96&d=retro&r=g\",\"caption\":\"laning\"},\"logo\":{\"@id\":\"https:\/\/blog.laning.org\/#personlogo\"},\"sameAs\":[\"https:\/\/blog.laning.org\"],\"url\":\"https:\/\/blog.laning.org\/index.php\/author\/laning\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u57fa\u4e8eCloudflare Worker\u7684Telegram\u4f20\u4fe1\u673a\u5668\u4eba &ndash; Laning &#039;s Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/blog.laning.org\/index.php\/2024\/09\/05\/424\/","og_locale":"zh_CN","og_type":"article","og_title":"\u57fa\u4e8eCloudflare Worker\u7684Telegram\u4f20\u4fe1\u673a\u5668\u4eba &ndash; Laning &#039;s Blog","og_description":"\u9879\u76ee\u539f\u56e0 Telegram\u662f\u5f88\u6ce8\u91cd\u9690\u79c1\u7684\u804a\u5929\u8f6f\u4ef6\uff0c\u53d7\u5230\u5f88\u591a\u4eba\u7684\u9752\u7750\u3002\u4f46\u662f\uff0c\u5982\u679c\u7ecf\u5e38\u548c\u964c\u751f\u4eba\u804a\u5929\u5f88\u5bb9\u6613\u89e6\u53d1\u98ce\u63a7\uff0c [&hellip;]","og_url":"https:\/\/blog.laning.org\/index.php\/2024\/09\/05\/424\/","og_site_name":"Laning &#039;s Blog","article_published_time":"2024-09-05T09:20:01+00:00","article_modified_time":"2025-03-29T09:19:21+00:00","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"laning"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebSite","@id":"https:\/\/blog.laning.org\/#website","url":"https:\/\/blog.laning.org\/","name":"\u8fa3\u5b81\u7684\u535a\u5ba2","description":"Learning on the go","publisher":{"@id":"https:\/\/blog.laning.org\/#\/schema\/person\/040331b403ed00370f2fc1e8eb6e6b93"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/blog.laning.org\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-CN"},{"@type":"WebPage","@id":"https:\/\/blog.laning.org\/index.php\/2024\/09\/05\/424\/#webpage","url":"https:\/\/blog.laning.org\/index.php\/2024\/09\/05\/424\/","name":"\u57fa\u4e8eCloudflare Worker\u7684Telegram\u4f20\u4fe1\u673a\u5668\u4eba &ndash; Laning &#039;s Blog","isPartOf":{"@id":"https:\/\/blog.laning.org\/#website"},"datePublished":"2024-09-05T09:20:01+00:00","dateModified":"2025-03-29T09:19:21+00:00","breadcrumb":{"@id":"https:\/\/blog.laning.org\/index.php\/2024\/09\/05\/424\/#breadcrumb"},"inLanguage":"zh-CN","potentialAction":[{"@type":"ReadAction","target":["https:\/\/blog.laning.org\/index.php\/2024\/09\/05\/424\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/blog.laning.org\/index.php\/2024\/09\/05\/424\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/blog.laning.org\/"},{"@type":"ListItem","position":2,"name":"\u57fa\u4e8eCloudflare Worker\u7684Telegram\u4f20\u4fe1\u673a\u5668\u4eba"}]},{"@type":"Article","@id":"https:\/\/blog.laning.org\/index.php\/2024\/09\/05\/424\/#article","isPartOf":{"@id":"https:\/\/blog.laning.org\/index.php\/2024\/09\/05\/424\/#webpage"},"author":{"@id":"https:\/\/blog.laning.org\/#\/schema\/person\/040331b403ed00370f2fc1e8eb6e6b93"},"headline":"\u57fa\u4e8eCloudflare Worker\u7684Telegram\u4f20\u4fe1\u673a\u5668\u4eba","datePublished":"2024-09-05T09:20:01+00:00","dateModified":"2025-03-29T09:19:21+00:00","mainEntityOfPage":{"@id":"https:\/\/blog.laning.org\/index.php\/2024\/09\/05\/424\/#webpage"},"wordCount":40,"commentCount":0,"publisher":{"@id":"https:\/\/blog.laning.org\/#\/schema\/person\/040331b403ed00370f2fc1e8eb6e6b93"},"articleSection":["Github"],"inLanguage":"zh-CN","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/blog.laning.org\/index.php\/2024\/09\/05\/424\/#respond"]}]},{"@type":["Person","Organization"],"@id":"https:\/\/blog.laning.org\/#\/schema\/person\/040331b403ed00370f2fc1e8eb6e6b93","name":"laning","image":{"@type":"ImageObject","@id":"https:\/\/blog.laning.org\/#personlogo","inLanguage":"zh-CN","url":"https:\/\/secure.gravatar.com\/avatar\/17215f328425d53537532588320693a1?s=96&d=retro&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/17215f328425d53537532588320693a1?s=96&d=retro&r=g","caption":"laning"},"logo":{"@id":"https:\/\/blog.laning.org\/#personlogo"},"sameAs":["https:\/\/blog.laning.org"],"url":"https:\/\/blog.laning.org\/index.php\/author\/laning\/"}]}},"_links":{"self":[{"href":"https:\/\/blog.laning.org\/index.php\/wp-json\/wp\/v2\/posts\/424"}],"collection":[{"href":"https:\/\/blog.laning.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.laning.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.laning.org\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.laning.org\/index.php\/wp-json\/wp\/v2\/comments?post=424"}],"version-history":[{"count":1,"href":"https:\/\/blog.laning.org\/index.php\/wp-json\/wp\/v2\/posts\/424\/revisions"}],"predecessor-version":[{"id":425,"href":"https:\/\/blog.laning.org\/index.php\/wp-json\/wp\/v2\/posts\/424\/revisions\/425"}],"wp:attachment":[{"href":"https:\/\/blog.laning.org\/index.php\/wp-json\/wp\/v2\/media?parent=424"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.laning.org\/index.php\/wp-json\/wp\/v2\/categories?post=424"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.laning.org\/index.php\/wp-json\/wp\/v2\/tags?post=424"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}