{"id":442,"date":"2025-04-09T18:38:01","date_gmt":"2025-04-09T10:38:01","guid":{"rendered":"https:\/\/blog.laning.org\/?p=442"},"modified":"2025-04-10T11:21:01","modified_gmt":"2025-04-10T03:21:01","slug":"tg%e6%9c%ba%e5%99%a8%e4%ba%ba%e9%80%9a%e7%9f%a5ip%e5%9c%b0%e5%9d%80","status":"publish","type":"post","link":"https:\/\/blog.laning.org\/index.php\/2025\/04\/09\/442\/","title":{"rendered":"TG\u673a\u5668\u4eba\u901a\u77e5IP\u5730\u5740"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">\u80cc\u666f<\/h2>\n\n\n\n<p>\u516c\u7f51IPv4\u653f\u7b56\u7684\u6536\u7d27\uff0c\u5305\u62ec\u4e0d\u9650\u4e8e\u4e0d\u80fd\u4f7f\u7528DDNS\u670d\u52a1\u89e3\u6790\u5230\u672a\u5907\u6848\u57df\u540d\uff0c\u56e0\u6b64\u4f7f\u7528TG\u673a\u5668\u4ebaAPI\u670d\u52a1\uff0c\u5b9a\u65f6\u68c0\u6d4bIP\u5730\u5740\uff0c\u82e5IP\u53d8\u5316\u5219\u81ea\u52a8\u66f4\u65b0<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u9879\u76ee\u5730\u5740<\/h2>\n\n\n\n<p><a href=\"https:\/\/raw.githubusercontent.com\/laningya\/Raspberry-Pi\/refs\/heads\/master\/shell\/telegram-ip-bot.sh\">Raspberry-Pi\/shell\/telegram-ip-bot.sh at master \u00b7 laningya\/Raspberry-Pi \u00b7 GitHub<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u90e8\u7f72\u8fc7\u7a0b<\/h2>\n\n\n\n<ul>\n<li>\u83b7\u53d6ChatID<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>API_TOKEN=\"YOUR_BOT_TOKEN\"<br>curl -s \"https:\/\/api.telegram.org\/bot$API_TOKEN\/getUpdates\" | jq '.result&#91;0].message.chat.id'<\/code><\/pre>\n\n\n\n<ul>\n<li>\u811a\u672c\u586b\u5165Bot\u7684API Token\uff0c\u4ee5\u53ca\u81ea\u884c\u5224\u65ad\u9700\u8981\u8bbe\u7f6e\u4ee3\u7406<\/li>\n\n\n\n<li>\u6dfb\u52a0crontab\u5b9a\u65f6\u4efb\u52a1<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>*\/30 * * * * \/bin\/bash \/root\/telegram-ip-bot.sh &gt; \/dev\/null 2&gt;&amp;1 &amp;<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u53c2\u8003\u6587\u6863<\/h2>\n\n\n\n<p><a href=\"https:\/\/core.telegram.org\/bots\/api\">Telegram Bot API<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u80cc\u666f \u516c\u7f51IPv4\u653f\u7b56\u7684\u6536\u7d27\uff0c\u5305\u62ec\u4e0d\u9650\u4e8e\u4e0d\u80fd\u4f7f\u7528DDNS\u670d\u52a1\u89e3\u6790\u5230\u672a\u5907\u6848\u57df\u540d\uff0c\u56e0\u6b64\u4f7f\u7528TG\u673a\u5668\u4ebaAPI\u670d\u52a1\uff0c\u5b9a [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v17.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>TG\u673a\u5668\u4eba\u901a\u77e5IP\u5730\u5740 &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\/2025\/04\/09\/442\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"TG\u673a\u5668\u4eba\u901a\u77e5IP\u5730\u5740 &ndash; Laning &#039;s Blog\" \/>\n<meta property=\"og:description\" content=\"\u80cc\u666f \u516c\u7f51IPv4\u653f\u7b56\u7684\u6536\u7d27\uff0c\u5305\u62ec\u4e0d\u9650\u4e8e\u4e0d\u80fd\u4f7f\u7528DDNS\u670d\u52a1\u89e3\u6790\u5230\u672a\u5907\u6848\u57df\u540d\uff0c\u56e0\u6b64\u4f7f\u7528TG\u673a\u5668\u4ebaAPI\u670d\u52a1\uff0c\u5b9a [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/blog.laning.org\/index.php\/2025\/04\/09\/442\/\" \/>\n<meta property=\"og:site_name\" content=\"Laning &#039;s Blog\" \/>\n<meta property=\"article:published_time\" content=\"2025-04-09T10:38:01+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-04-10T03:21:01+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\/2025\/04\/09\/442\/#webpage\",\"url\":\"https:\/\/blog.laning.org\/index.php\/2025\/04\/09\/442\/\",\"name\":\"TG\\u673a\\u5668\\u4eba\\u901a\\u77e5IP\\u5730\\u5740 &ndash; Laning &#039;s Blog\",\"isPartOf\":{\"@id\":\"https:\/\/blog.laning.org\/#website\"},\"datePublished\":\"2025-04-09T10:38:01+00:00\",\"dateModified\":\"2025-04-10T03:21:01+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/blog.laning.org\/index.php\/2025\/04\/09\/442\/#breadcrumb\"},\"inLanguage\":\"zh-CN\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/blog.laning.org\/index.php\/2025\/04\/09\/442\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/blog.laning.org\/index.php\/2025\/04\/09\/442\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\\u9996\\u9875\",\"item\":\"https:\/\/blog.laning.org\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"TG\\u673a\\u5668\\u4eba\\u901a\\u77e5IP\\u5730\\u5740\"}]},{\"@type\":\"Article\",\"@id\":\"https:\/\/blog.laning.org\/index.php\/2025\/04\/09\/442\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/blog.laning.org\/index.php\/2025\/04\/09\/442\/#webpage\"},\"author\":{\"@id\":\"https:\/\/blog.laning.org\/#\/schema\/person\/040331b403ed00370f2fc1e8eb6e6b93\"},\"headline\":\"TG\\u673a\\u5668\\u4eba\\u901a\\u77e5IP\\u5730\\u5740\",\"datePublished\":\"2025-04-09T10:38:01+00:00\",\"dateModified\":\"2025-04-10T03:21:01+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/blog.laning.org\/index.php\/2025\/04\/09\/442\/#webpage\"},\"wordCount\":25,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/blog.laning.org\/#\/schema\/person\/040331b403ed00370f2fc1e8eb6e6b93\"},\"articleSection\":[\"Linux\"],\"inLanguage\":\"zh-CN\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/blog.laning.org\/index.php\/2025\/04\/09\/442\/#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":"TG\u673a\u5668\u4eba\u901a\u77e5IP\u5730\u5740 &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\/2025\/04\/09\/442\/","og_locale":"zh_CN","og_type":"article","og_title":"TG\u673a\u5668\u4eba\u901a\u77e5IP\u5730\u5740 &ndash; Laning &#039;s Blog","og_description":"\u80cc\u666f \u516c\u7f51IPv4\u653f\u7b56\u7684\u6536\u7d27\uff0c\u5305\u62ec\u4e0d\u9650\u4e8e\u4e0d\u80fd\u4f7f\u7528DDNS\u670d\u52a1\u89e3\u6790\u5230\u672a\u5907\u6848\u57df\u540d\uff0c\u56e0\u6b64\u4f7f\u7528TG\u673a\u5668\u4ebaAPI\u670d\u52a1\uff0c\u5b9a [&hellip;]","og_url":"https:\/\/blog.laning.org\/index.php\/2025\/04\/09\/442\/","og_site_name":"Laning &#039;s Blog","article_published_time":"2025-04-09T10:38:01+00:00","article_modified_time":"2025-04-10T03:21:01+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\/2025\/04\/09\/442\/#webpage","url":"https:\/\/blog.laning.org\/index.php\/2025\/04\/09\/442\/","name":"TG\u673a\u5668\u4eba\u901a\u77e5IP\u5730\u5740 &ndash; Laning &#039;s Blog","isPartOf":{"@id":"https:\/\/blog.laning.org\/#website"},"datePublished":"2025-04-09T10:38:01+00:00","dateModified":"2025-04-10T03:21:01+00:00","breadcrumb":{"@id":"https:\/\/blog.laning.org\/index.php\/2025\/04\/09\/442\/#breadcrumb"},"inLanguage":"zh-CN","potentialAction":[{"@type":"ReadAction","target":["https:\/\/blog.laning.org\/index.php\/2025\/04\/09\/442\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/blog.laning.org\/index.php\/2025\/04\/09\/442\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/blog.laning.org\/"},{"@type":"ListItem","position":2,"name":"TG\u673a\u5668\u4eba\u901a\u77e5IP\u5730\u5740"}]},{"@type":"Article","@id":"https:\/\/blog.laning.org\/index.php\/2025\/04\/09\/442\/#article","isPartOf":{"@id":"https:\/\/blog.laning.org\/index.php\/2025\/04\/09\/442\/#webpage"},"author":{"@id":"https:\/\/blog.laning.org\/#\/schema\/person\/040331b403ed00370f2fc1e8eb6e6b93"},"headline":"TG\u673a\u5668\u4eba\u901a\u77e5IP\u5730\u5740","datePublished":"2025-04-09T10:38:01+00:00","dateModified":"2025-04-10T03:21:01+00:00","mainEntityOfPage":{"@id":"https:\/\/blog.laning.org\/index.php\/2025\/04\/09\/442\/#webpage"},"wordCount":25,"commentCount":0,"publisher":{"@id":"https:\/\/blog.laning.org\/#\/schema\/person\/040331b403ed00370f2fc1e8eb6e6b93"},"articleSection":["Linux"],"inLanguage":"zh-CN","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/blog.laning.org\/index.php\/2025\/04\/09\/442\/#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\/442"}],"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=442"}],"version-history":[{"count":3,"href":"https:\/\/blog.laning.org\/index.php\/wp-json\/wp\/v2\/posts\/442\/revisions"}],"predecessor-version":[{"id":445,"href":"https:\/\/blog.laning.org\/index.php\/wp-json\/wp\/v2\/posts\/442\/revisions\/445"}],"wp:attachment":[{"href":"https:\/\/blog.laning.org\/index.php\/wp-json\/wp\/v2\/media?parent=442"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.laning.org\/index.php\/wp-json\/wp\/v2\/categories?post=442"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.laning.org\/index.php\/wp-json\/wp\/v2\/tags?post=442"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}