{"id":98,"date":"2025-09-29T15:11:34","date_gmt":"2025-09-29T07:11:34","guid":{"rendered":"https:\/\/blog.rubox.top\/?p=98"},"modified":"2026-02-08T14:20:12","modified_gmt":"2026-02-08T06:20:12","slug":"linux-bot%e6%90%ad%e5%bb%ba%e7%ac%94%e8%ae%b0","status":"publish","type":"post","link":"https:\/\/297123.xyz\/index.php\/2025\/09\/29\/linux-bot%e6%90%ad%e5%bb%ba%e7%ac%94%e8%ae%b0\/","title":{"rendered":"QQ\u7fa4Bot\u642d\u5efa\u7b14\u8bb0-Linux\u7bc7"},"content":{"rendered":"\n<h3 class=\"wp-block-heading\">\u524d\u8a00<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u56e0\u4e3a\u6211\u62ffWindows\u642d\u7684bot\u4e00\u5929\u80fd\u88ab\u5c01\u4e94\u516d\u56de\u8feb\u4e0d\u5f97\u5df2\u8fc1\u79fb\u5230Linux\u4e86<\/li>\n\n\n\n<li>\u6587\u7ae0\u53ea\u5199\u4e86\u6574\u4f53\u6d41\u7a0b\uff0c\u81f3\u4e8e\u865a\u62df\u73af\u5883\u3001screen\u4f1a\u8bdd\u8fd9\u79cd\u8bf7\u81ea\u884c\u5b89\u88c5\u4f7f\u7528<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">\u6b63\u6587<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u7cfb\u7edf\uff1aUbuntu22.04 LTS Server<\/li>\n\n\n\n<li>\u914d\u7f6e\uff1a1\u6838\u5fc32\u7ebf\u7a0b<\/li>\n\n\n\n<li>\u78c1\u76d8\u7a7a\u95f4\uff1a30G<\/li>\n\n\n\n<li>\u7f51\u7edc\u72b6\u6001\uff1a\u6865\u63a5 # \u63d0\u524d\u5728\u8def\u7531\u5668\u4e3a\u865a\u62df\u673a\u5206\u914dMAC\u5730\u5740\u548cIP\u5730\u5740\uff0c\u5728\u865a\u62df\u673a\u5b89\u88c5\u524d\u4fee\u6539\u7f51\u7edc\u8bbe\u7f6e\u4e2d\u7684MAC\u5730\u5740<\/li>\n\n\n\n<li>\u865a\u62df\u673a\u5b89\u88c5\u8be6\u7ec6\u6559\u7a0b\u6765\u81eaCSDN\u7684\u5e16\u5b50\uff1a<a href=\"https:\/\/blog.csdn.net\/qq_62124267\/article\/details\/132248263\" data-type=\"link\" data-id=\"https:\/\/blog.csdn.net\/qq_62124267\/article\/details\/132248263\">\u94fe\u63a5<\/a>\uff0c\u9700\u8981\u8865\u5145\u4e00\u70b9\uff0c\u4f7f\u7528VMWare17+\u7248\u672c\uff0c\u6211\u4f7f\u752816+\u7248\u672c\u65e0\u6cd5\u5b89\u88c5<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">\u5b89\u88c5\u6d41\u7a0b<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt update # \u66f4\u65b0\u8f6f\u4ef6\u5305\nsudo ln -s \/usr\/bin\/python3 \/usr\/bin\/python # \u521b\u5efa\u8f6f\u94fe\u63a5\npython -m pip install --user pipx # \u5b89\u88c5 pipx\npython -m pipx ensurepath # \u5b89\u88c5 pipx\npipx install nb-cli # \u5b89\u88c5\u811a\u624b\u67b6\necho 'export PATH=$PATH:\/root\/.local\/bin' &gt;&gt; ~\/.bashrc # \u6dfb\u52a0path\nsource ~\/.bashrc # \u6dfb\u52a0path<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>nb #\u8fd0\u884cnonebot<\/li>\n\n\n\n<li>\u9009\u62e9\u201c\u521b\u5efa\u65b0\u7684Bot\u201d<\/li>\n\n\n\n<li>\u8f93\u5165\u9879\u76ee\u540d\u79f0&#8221;bot-xiaomian&#8221;<\/li>\n\n\n\n<li>\u5168\u9009\u9a71\u52a8\u5668<\/li>\n\n\n\n<li>\u7acb\u5373\u5b89\u88c5\u4f9d\u8d56? (Y\/n) Yes<\/li>\n\n\n\n<li>\u521b\u5efa\u865a\u62df\u73af\u5883? (Y\/n) No<\/li>\n\n\n\n<li>\u8981\u4f7f\u7528\u54ea\u4e9b\u5185\u7f6e\u63d2\u4ef6? echo<\/li>\n\n\n\n<li>cd bot-xiaomian # \u8fdb\u5165Bot\u76ee\u5f55<\/li>\n\n\n\n<li>\u5b89\u88c5\u63d2\u4ef6\uff0c\u540c<a href=\"https:\/\/blog.rubox.top\/index.php\/2025\/09\/10\/windows-bot%e6%90%ad%e5%bb%ba%e7%ac%94%e8%ae%b0\/\" data-type=\"link\" data-id=\"https:\/\/blog.rubox.top\/index.php\/2025\/09\/10\/windows-bot%e6%90%ad%e5%bb%ba%e7%ac%94%e8%ae%b0\/\">Windows<\/a><\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>nb plugin install nonebot_plugin_memes #\u8868\u60c5\u5305\u5236\u4f5c\nnb plugin install nonebot-plugin-capoo #\u968f\u673a\u5496\u6ce2\u8868\u60c5\nnb plugin install nonebot-plugin-marshoai #\u5c0f\u68c9\u667a\u80fd\nnb plugin install nonebot_plugin_emojimix #emoji \u5408\u6210\nnb plugin install nonebot_plugin_boardgame #\u68cb\u7c7b\u6e38\u620f\nnb plugin install nonebot-plugin-whateat-pic \u2013upgrade #\u5403\u4ec0\u4e48\nnb plugin install nonebot_plugin_minesweeper #\u626b\u96f7<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5b89\u88c51Panel<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>bash -c \"$(curl -sSL https:\/\/resource.fit2cloud.com\/1panel\/package\/v2\/quick_start.sh)\"<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u8fdb\u5165\u9762\u677f\uff0c\u627e\u5230\/root\/bot-xiaomian\/.env.prod\uff0c\u4fee\u6539\u4e3a\u4e0b\u5217\u914d\u7f6e\u4fdd\u5b58<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>DRIVER=~fastapi+~httpx+~websockets # \u9a71\u52a8\u5668\nHOST=127.0.0.1 # \u914d\u7f6e NoneBot \u76d1\u542c\u7684 IP \/ \u4e3b\u673a\u540d\nPORT=8080 # \u914d\u7f6e NoneBot \u76d1\u542c\u7684\u7aef\u53e3\nONEBOT_ACCESS_TOKEN=password # \u81ea\u5b9a\u4e49\u901a\u4fe1\u5bc6\u7801\nmarshoai_token=token # GitHub \u5904\u6dfb\u52a0\u7684 token\ncapoo_download=true # \u5496\u6ce2\u968f\u673a\u8868\u60c5\u7684\u672c\u5730\u5b58\u50a8\u5f00\u5173\nNICKNAME=&#91;\"name\"] # name\u66ff\u6362\u4e3a\u4f60\u7684\u673a\u5668\u4eba\u6635\u79f0<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5b89\u88c5NapCat<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>curl -o napcat.sh https:\/\/nclatest.znin.net\/NapNeko\/NapCat-Installer\/main\/script\/install.sh &amp;&amp; sudo bash napcat.sh # \u5b89\u88c5napcat<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u4e0d\u4f7f\u7528Docker #\u5982\u679c\u4f60\u8981\u7528docker\u5c31\u628a\u4e0b\u6587\u7684ip\u7aef\u53e3\u6539\u6210\u5bf9\u5e94\u5bb9\u5668\u7684\uff0c\u53ef\u80fd\u9700\u8981\u653e\u884c\u6307\u5b9aIP\uff0c\u6bd4\u5982172.17.0.1<\/li>\n\n\n\n<li>\u540c\u610f\u5b89\u88c5Cil<\/li>\n\n\n\n<li>\u5b89\u88c5\u5b8c\u6210\u540e\u8f93\u5165 napcat \u542f\u52a8bot\uff0c\u6309\u7167\u63d0\u793a\u767b\u5f55QQ\uff0c\u540c\u65f6\u7ffb\u9605\u627e\u5230token<\/li>\n\n\n\n<li>\u6253\u5f00\u7f51\u9875 http:\/\/IP+6099 \uff0c\u8f93\u5165token<\/li>\n\n\n\n<li>\u70b9\u51fb \u5176\u4ed6\u8bbe\u7f6e-\u4fee\u6539\u5bc6\u7801\uff0c\u8bbe\u7f6e\u4e00\u4e2a\u5bc6\u7801<\/li>\n\n\n\n<li>\u70b9\u51fb \u7f51\u7edc\u8bbe\u7f6e-\u65b0\u5efa-WebSockets\u5ba2\u6237\u7aef\uff0c\u914d\u7f6e\u5982\u4e0b\n<ul class=\"wp-block-list\">\n<li>\u52fe\u9009&#8221;\u542f\u52a8&#8221;<\/li>\n\n\n\n<li>\u8bbe\u7f6e\u4e00\u4e2a\u540d\u79f0\uff08\u6700\u597d\u662f\u82f1\u6587\uff09<\/li>\n\n\n\n<li>\u8f93\u5165 URL\uff0cws:\/\/127.0.0.1:\u7aef\u53e3\/onebot\/v11\/ws\uff0c\u7aef\u53e3\u4e3a&#8221;.env.prod&#8221;\u6587\u4ef6\u4e2d\u7684\u201cPORT\u201d<\/li>\n\n\n\n<li>\u4e0d\u8981\u52fe\u9009&#8221;\u4e0a\u62a5\u81ea\u8eab\u6d88\u606f&#8221;<\/li>\n\n\n\n<li>\u8f93\u5165token\uff0ctoken \u4e3a&#8221;.env.prod&#8221;\u6587\u4ef6\u4e2d\u7684&#8221;ONEBOT_ACCESS_TOKEN&#8221;<\/li>\n\n\n\n<li>\u5176\u4ed6\u8bbe\u7f6e\u4fdd\u6301\u9ed8\u8ba4\uff0c\u70b9\u51fb\u4fdd\u5b58<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u9000\u51fanapcat<\/li>\n\n\n\n<li>\u8f93\u5165<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>pip install nonebot-plugin-orm&#91;default] # \u521d\u59cb\u5316\u6570\u636e\u5e93\nnb run --reload # \u521d\u59cb\u5316nonebot\n\u51fa\u73b0\u63d0\u793a\u9009\u62e9Y<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u52a0\u8f7d\u5b8c\u6bd5\u540e\u65ad\u5f00\u7ec8\u7aef\u8fde\u63a5\uff0c\u91cd\u65b0\u8fde\u63a5\u7ec8\u7aef\uff0c\u8f93\u5165<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>nb run &amp;<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u89c2\u5bdfNapCat\u7f51\u9875-\u732b\u732b\u65e5\u5fd7\u6216\u7ec8\u7aef\uff0c\u662f\u5426\u51fa\u73b0\u8fde\u63a5\u6210\u529f\u5b57\u6837\uff0c\u6ca1\u6709\u5c31\u7b49\u5f8530\u79d2<\/li>\n\n\n\n<li>\u81f3\u6b64NoneBot\u548cNapCat\u642d\u5efa\u5b8c\u6210<\/li>\n\n\n\n<li>\u540e\u7eed\u91cd\u65b0\u8fd0\u884c\u6307\u4ee4\u5982\u4e0b<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo -i # \u767b\u5f55root\npassword # \u8f93\u5165\u5bc6\u7801\ncd bot-xiaomian # \u8fdb\u5165\u76ee\u5f55\nscreen -dmS napcat bash -c \"xvfb-run -a qq --no-sandbox -q \u8d26\u53f7\" # \u8d26\u53f7\u4e3a\u767b\u5f55\u7684QQ\u53f7\n\u6216\u4f7f\u7528\nNapCat # \u6309\u7167\u63d0\u793a\u767b\u5f55\nnb run &amp; # \u540e\u53f0\u8fd0\u884cNonaBot\nnb run --reload &amp; # \u540e\u53f0\u91cd\u65b0\u52a0\u8f7d\u8fd0\u884cNoneBot\n<\/code><\/pre>\n\n\n\n<h5 class=\"wp-block-heading\">tips<\/h5>\n\n\n\n<p>\u8fd8\u53ef\u4ee5\u57281Panel\u5546\u5e97\u4e2d\u5b89\u88c5astrbot\uff0c\u8fd9\u4e2a\u5f88\u65b9\u4fbf\uff0c\u64cd\u4f5c\u4e5f\u5f88\u7b80\u5355\u5168\u90fd\u662f\u53ef\u89c6\u5316\u7684\u5c31\u4e0d\u8d58\u8ff0\u4e86<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u524d\u8a00 \u6b63\u6587 \u5b89\u88c5\u6d41\u7a0b tips \u8fd8\u53ef\u4ee5\u57281Panel\u5546\u5e97\u4e2d\u5b89\u88c5astrbot\uff0c\u8fd9\u4e2a\u5f88\u65b9\u4fbf\uff0c\u64cd\u4f5c\u4e5f\u5f88\u7b80\u5355\u5168\u90fd\u662f\u53ef [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":190,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[11,8],"class_list":["post-98","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-learn","tag-11","tag-8"],"_links":{"self":[{"href":"https:\/\/297123.xyz\/index.php\/wp-json\/wp\/v2\/posts\/98","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/297123.xyz\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/297123.xyz\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/297123.xyz\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/297123.xyz\/index.php\/wp-json\/wp\/v2\/comments?post=98"}],"version-history":[{"count":7,"href":"https:\/\/297123.xyz\/index.php\/wp-json\/wp\/v2\/posts\/98\/revisions"}],"predecessor-version":[{"id":204,"href":"https:\/\/297123.xyz\/index.php\/wp-json\/wp\/v2\/posts\/98\/revisions\/204"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/297123.xyz\/index.php\/wp-json\/wp\/v2\/media\/190"}],"wp:attachment":[{"href":"https:\/\/297123.xyz\/index.php\/wp-json\/wp\/v2\/media?parent=98"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/297123.xyz\/index.php\/wp-json\/wp\/v2\/categories?post=98"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/297123.xyz\/index.php\/wp-json\/wp\/v2\/tags?post=98"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}