"use strict";(self.webpackChunkzhenxun_docs=self.webpackChunkzhenxun_docs||[]).push([[5389],{983:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>i,default:()=>d,frontMatter:()=>s,metadata:()=>a,toc:()=>u});var l=t(4848),r=t(8453);t(1470),t(9365);const s={title:"\u5b89\u88c5\u5c0f\u771f\u5bfb(nb-cli)",subSidebar:!1,id:"nb-install-zhenxun"},i=void 0,a={id:"install/zhenxun/nb-install-zhenxun",title:"\u5b89\u88c5\u5c0f\u771f\u5bfb(nb-cli)",description:"\u771f\u5bfbBot\u9700\u8981python\u7248\u672c\u4e3a >=3.10",source:"@site/docs/install/zhenxun/nb-cli.md",sourceDirName:"install/zhenxun",slug:"/install/zhenxun/nb-install-zhenxun",permalink:"/zhenxun_bot/install/zhenxun/nb-install-zhenxun",draft:!1,unlisted:!1,editUrl:"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/docs/install/zhenxun/nb-cli.md",tags:[],version:"current",frontMatter:{title:"\u5b89\u88c5\u5c0f\u771f\u5bfb(nb-cli)",subSidebar:!1,id:"nb-install-zhenxun"},sidebar:"installSidebar",previous:{title:"\u5b89\u88c5QQ",permalink:"/zhenxun_bot/install/install-qq"},next:{title:"\u5b89\u88c5\u5c0f\u771f\u5bfb(\u624b\u52a8)",permalink:"/zhenxun_bot/install/zhenxun/"}},c={},u=[{value:"\u5b89\u88c5nb-cli",id:"\u5b89\u88c5nb-cli",level:2},{value:"\u5b89\u88c5plugin-zhenxun",id:"\u5b89\u88c5plugin-zhenxun",level:2},{value:"\u4f7f\u7528nb-cli",id:"\u4f7f\u7528nb-cli",level:3},{value:"\u4f7f\u7528pip",id:"\u4f7f\u7528pip",level:3},{value:"\u5b89\u88c5\u771f\u5bfb",id:"\u5b89\u88c5\u771f\u5bfb",level:2},{value:"\u542f\u52a8",id:"\u542f\u52a8",level:2},{value:"\u5f53\u4f60\u7684\u63a7\u5236\u53f0\u51fa\u73b0\u4ee5\u4e0b\u65e5\u5fd7\uff0c\u8bf4\u660e\u4f60\u5df2\u7ecf\u6210\u529f\u4e86\ud83c\udf89\ud83c\udf89",id:"\u5f53\u4f60\u7684\u63a7\u5236\u53f0\u51fa\u73b0\u4ee5\u4e0b\u65e5\u5fd7\u8bf4\u660e\u4f60\u5df2\u7ecf\u6210\u529f\u4e86",level:4}];function o(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",h4:"h4",hr:"hr",img:"img",li:"li",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,r.R)(),...e.components};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(n.admonition,{title:"\u7248\u672c\u8b66\u544a",type:"warning",children:(0,l.jsxs)(n.p,{children:["\u771f\u5bfbBot\u9700\u8981python\u7248\u672c\u4e3a ",(0,l.jsx)(n.strong,{children:">=3.10"})]})}),"\n",(0,l.jsx)(n.h2,{id:"\u5b89\u88c5nb-cli",children:"\u5b89\u88c5nb-cli"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-shell",children:"pip install nb-cli\n"})}),"\n",(0,l.jsx)(n.h2,{id:"\u5b89\u88c5plugin-zhenxun",children:"\u5b89\u88c5plugin-zhenxun"}),"\n",(0,l.jsx)(n.h3,{id:"\u4f7f\u7528nb-cli",children:"\u4f7f\u7528nb-cli"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-shell",children:"nb self install nb-cli-plugin-zhenxun\n"})}),"\n",(0,l.jsx)(n.h3,{id:"\u4f7f\u7528pip",children:"\u4f7f\u7528pip"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-shell",children:"pip install nb-cli-plugin-zhenxun\n"})}),"\n",(0,l.jsx)(n.h2,{id:"\u5b89\u88c5\u771f\u5bfb",children:"\u5b89\u88c5\u771f\u5bfb"}),"\n",(0,l.jsx)(n.hr,{}),"\n",(0,l.jsx)(n.p,{children:"1.\u4f7f\u7528nb-cli\u547d\u4ee4"}),"\n",(0,l.jsx)(n.p,{children:"\u9009\u62e9\u5728\u5f53\u524d\u76ee\u5f55\u5b89\u88c5\u5c0f\u771f\u5bfb"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-shell",children:"nb zx\n"})}),"\n",(0,l.jsx)(n.p,{children:(0,l.jsx)(n.img,{alt:"_",src:t(4039).A+"",width:"2182",height:"396"})}),"\n",(0,l.jsx)(n.p,{children:"2.\u6309\u81ea\u8eab\u60c5\u51b5\u9009\u62e9\u5b89\u88c5\u65b9\u5f0f\uff0c\u8fd9\u91cc\u9009\u62e9\u4e0b\u8f7d\u5b89\u88c5"}),"\n",(0,l.jsx)(n.p,{children:(0,l.jsx)(n.img,{alt:"_",src:t(3980).A+"",width:"1366",height:"200"})}),"\n",(0,l.jsx)(n.p,{children:"3.\u7b49\u5f85\u4e0b\u8f7d\u5b8c\u6210\u5e76\u6839\u636e\u63d0\u793a\u8bbe\u7f6e\u914d\u7f6e"}),"\n",(0,l.jsx)(n.p,{children:(0,l.jsx)(n.img,{alt:"_",src:t(3077).A+"",width:"2336",height:"882"})}),"\n",(0,l.jsx)(n.p,{children:"4.\u6839\u636e\u63d0\u793a\u5b8c\u6210\u540e\u542f\u52a8"}),"\n",(0,l.jsx)(n.p,{children:(0,l.jsx)(n.img,{alt:"_",src:t(6570).A+"",width:"836",height:"388"})}),"\n",(0,l.jsx)(n.h2,{id:"\u542f\u52a8",children:"\u542f\u52a8"}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsx)(n.li,{children:"\u4f7f\u7528\u666e\u901a\u547d\u4ee4"}),"\n"]}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-shell",children:"cd zhenxun_bot\n\npoetry run python bot.py\n"})}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsx)(n.li,{children:"\u4f7f\u7528nb-cli"}),"\n"]}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-shell",children:"cd zhenxun_bot\n\nnb zx start\n"})}),"\n",(0,l.jsx)(n.h4,{id:"\u5f53\u4f60\u7684\u63a7\u5236\u53f0\u51fa\u73b0\u4ee5\u4e0b\u65e5\u5fd7\u8bf4\u660e\u4f60\u5df2\u7ecf\u6210\u529f\u4e86",children:"\u5f53\u4f60\u7684\u63a7\u5236\u53f0\u51fa\u73b0\u4ee5\u4e0b\u65e5\u5fd7\uff0c\u8bf4\u660e\u4f60\u5df2\u7ecf\u6210\u529f\u4e86\ud83c\udf89\ud83c\udf89"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-bash",children:"08-14 23:18:44 [INFO] zhenxun | CMD[Web UI] API\u542f\u52a8\u6210\u529f\n08-14 23:18:44 [INFO] uvicorn | Application startup complete.\n08-14 23:18:44 [INFO] uvicorn | Uvicorn running on http://127.0.0.1:8080 (Press CTRL+C to quit)\n"})}),"\n",(0,l.jsx)(n.admonition,{title:"\u63d0\u793a",type:"tip",children:(0,l.jsx)(n.p,{children:"\u5f53\u524d\u7248\u672c\u771f\u5bfb\u672c\u4f53\u4e0e\u63d2\u4ef6\u5e93\u5206\u79bb\uff0c\u4f60\u53ef\u4ee5\u5728\u4ee5\u4e0b\u83b7\u53d6\u63d2\u4ef6\u6216\u5176\u4ed6\u76f8\u5173\uff0c\u6216\u901a\u8fc7\u4e0e\u771f\u5bfb\u7684\u5bf9\u8bdd\u547d\u4ee4\u5b89\u88c5\u63d2\u4ef6\uff08\u63d2\u4ef6\u5546\u5e97\uff09"})}),"\n",(0,l.jsxs)(n.table,{children:[(0,l.jsx)(n.thead,{children:(0,l.jsxs)(n.tr,{children:[(0,l.jsx)(n.th,{style:{textAlign:"center"},children:"\u9879\u76ee\u540d\u79f0"}),(0,l.jsx)(n.th,{style:{textAlign:"center"},children:"\u4e3b\u8981\u7528\u9014"}),(0,l.jsx)(n.th,{style:{textAlign:"center"},children:"\u4ed3\u5e93\u4f5c\u8005"}),(0,l.jsx)(n.th,{style:{textAlign:"center"},children:"\u5907\u6ce8"})]})}),(0,l.jsxs)(n.tbody,{children:[(0,l.jsxs)(n.tr,{children:[(0,l.jsx)(n.td,{style:{textAlign:"center"},children:(0,l.jsx)(n.a,{href:"https://github.com/zhenxun-org/zhenxun_bot_plugins",children:"\u63d2\u4ef6\u5e93"})}),(0,l.jsx)(n.td,{style:{textAlign:"center"},children:"\u63d2\u4ef6"}),(0,l.jsx)(n.td,{style:{textAlign:"center"},children:(0,l.jsx)(n.a,{href:"https://github.com/zhenxun-org",children:"zhenxun-org"})}),(0,l.jsx)(n.td,{style:{textAlign:"center"},children:"\u539f plugins \u6587\u4ef6\u5939\u63d2\u4ef6"})]}),(0,l.jsxs)(n.tr,{children:[(0,l.jsx)(n.td,{style:{textAlign:"center"},children:(0,l.jsx)(n.a,{href:"https://github.com/zhenxun-org/zhenxun_bot_plugins_index",children:"\u63d2\u4ef6\u7d22\u5f15\u5e93"})}),(0,l.jsx)(n.td,{style:{textAlign:"center"},children:"\u63d2\u4ef6"}),(0,l.jsx)(n.td,{style:{textAlign:"center"},children:(0,l.jsx)(n.a,{href:"https://github.com/zhenxun-org",children:"zhenxun-org"})}),(0,l.jsx)(n.td,{style:{textAlign:"center"},children:"\u6269\u5c55\u63d2\u4ef6\u7d22\u5f15\u5e93"})]}),(0,l.jsxs)(n.tr,{children:[(0,l.jsx)(n.td,{style:{textAlign:"center"},children:(0,l.jsx)(n.a,{href:"https://github.com/soloxiaoye2022/zhenxun_bot-deploy",children:"\u4e00\u952e\u5b89\u88c5"})}),(0,l.jsx)(n.td,{style:{textAlign:"center"},children:"\u5b89\u88c5"}),(0,l.jsx)(n.td,{style:{textAlign:"center"},children:(0,l.jsx)(n.a,{href:"https://github.com/soloxiaoye2022",children:"soloxiaoye2022"})}),(0,l.jsx)(n.td,{style:{textAlign:"center"},children:"\u7b2c\u4e09\u65b9"})]}),(0,l.jsxs)(n.tr,{children:[(0,l.jsx)(n.td,{style:{textAlign:"center"},children:(0,l.jsx)(n.a,{href:"https://github.com/HibiKier/zhenxun_bot_webui",children:"WebUi"})}),(0,l.jsx)(n.td,{style:{textAlign:"center"},children:"\u7ba1\u7406"}),(0,l.jsx)(n.td,{style:{textAlign:"center"},children:(0,l.jsx)(n.a,{href:"https://github.com/HibiKier",children:"hibikier"})}),(0,l.jsx)(n.td,{style:{textAlign:"center"},children:"\u57fa\u4e8e\u771f\u5bfb WebApi \u7684 webui \u5b9e\u73b0"})]}),(0,l.jsxs)(n.tr,{children:[(0,l.jsx)(n.td,{style:{textAlign:"center"},children:(0,l.jsx)(n.a,{href:"https://github.com/YuS1aN/zhenxun_bot_android_ui",children:"\u5b89\u5353 app(WebUi)"})}),(0,l.jsx)(n.td,{style:{textAlign:"center"},children:"\u5b89\u88c5"}),(0,l.jsx)(n.td,{style:{textAlign:"center"},children:(0,l.jsx)(n.a,{href:"https://github.com/YuS1aN",children:"YuS1aN"})}),(0,l.jsx)(n.td,{style:{textAlign:"center"},children:"\u7b2c\u4e09\u65b9"})]})]})]})]})}function d(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,l.jsx)(n,{...e,children:(0,l.jsx)(o,{...e})}):o(e)}},9365:(e,n,t)=>{t.d(n,{A:()=>i});t(6540);var l=t(4164);const r={tabItem:"tabItem_Ymn6"};var s=t(4848);function i(e){let{children:n,hidden:t,className:i}=e;return(0,s.jsx)("div",{role:"tabpanel",className:(0,l.A)(r.tabItem,i),hidden:t,children:n})}},1470:(e,n,t)=>{t.d(n,{A:()=>A});var l=t(6540),r=t(4164),s=t(3104),i=t(6347),a=t(205),c=t(7485),u=t(1682),o=t(679);function d(e){return l.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,l.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function h(e){const{values:n,children:t}=e;return(0,l.useMemo)((()=>{const e=n??function(e){return d(e).map((e=>{let{props:{value:n,label:t,attributes:l,default:r}}=e;return{value:n,label:t,attributes:l,default:r}}))}(t);return function(e){const n=(0,u.XI)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,t])}function x(e){let{value:n,tabValues:t}=e;return t.some((e=>e.value===n))}function p(e){let{queryString:n=!1,groupId:t}=e;const r=(0,i.W6)(),s=function(e){let{queryString:n=!1,groupId:t}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!t)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return t??null}({queryString:n,groupId:t});return[(0,c.aZ)(s),(0,l.useCallback)((e=>{if(!s)return;const n=new URLSearchParams(r.location.search);n.set(s,e),r.replace({...r.location,search:n.toString()})}),[s,r])]}function b(e){const{defaultValue:n,queryString:t=!1,groupId:r}=e,s=h(e),[i,c]=(0,l.useState)((()=>function(e){let{defaultValue:n,tabValues:t}=e;if(0===t.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!x({value:n,tabValues:t}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${t.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const l=t.find((e=>e.default))??t[0];if(!l)throw new Error("Unexpected error: 0 tabValues");return l.value}({defaultValue:n,tabValues:s}))),[u,d]=p({queryString:t,groupId:r}),[b,g]=function(e){let{groupId:n}=e;const t=function(e){return e?`docusaurus.tab.${e}`:null}(n),[r,s]=(0,o.Dv)(t);return[r,(0,l.useCallback)((e=>{t&&s.set(e)}),[t,s])]}({groupId:r}),j=(()=>{const e=u??b;return x({value:e,tabValues:s})?e:null})();(0,a.A)((()=>{j&&c(j)}),[j]);return{selectedValue:i,selectValue:(0,l.useCallback)((e=>{if(!x({value:e,tabValues:s}))throw new Error(`Can't select invalid tab value=${e}`);c(e),d(e),g(e)}),[d,g,s]),tabValues:s}}var g=t(2303);const j={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var m=t(4848);function f(e){let{className:n,block:t,selectedValue:l,selectValue:i,tabValues:a}=e;const c=[],{blockElementScrollPositionUntilNextRender:u}=(0,s.a_)(),o=e=>{const n=e.currentTarget,t=c.indexOf(n),r=a[t].value;r!==l&&(u(n),i(r))},d=e=>{let n=null;switch(e.key){case"Enter":o(e);break;case"ArrowRight":{const t=c.indexOf(e.currentTarget)+1;n=c[t]??c[0];break}case"ArrowLeft":{const t=c.indexOf(e.currentTarget)-1;n=c[t]??c[c.length-1];break}}n?.focus()};return(0,m.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,r.A)("tabs",{"tabs--block":t},n),children:a.map((e=>{let{value:n,label:t,attributes:s}=e;return(0,m.jsx)("li",{role:"tab",tabIndex:l===n?0:-1,"aria-selected":l===n,ref:e=>c.push(e),onKeyDown:d,onClick:o,...s,className:(0,r.A)("tabs__item",j.tabItem,s?.className,{"tabs__item--active":l===n}),children:t??n},n)}))})}function v(e){let{lazy:n,children:t,selectedValue:s}=e;const i=(Array.isArray(t)?t:[t]).filter(Boolean);if(n){const e=i.find((e=>e.props.value===s));return e?(0,l.cloneElement)(e,{className:(0,r.A)("margin-top--md",e.props.className)}):null}return(0,m.jsx)("div",{className:"margin-top--md",children:i.map(((e,n)=>(0,l.cloneElement)(e,{key:n,hidden:e.props.value!==s})))})}function y(e){const n=b(e);return(0,m.jsxs)("div",{className:(0,r.A)("tabs-container",j.tabList),children:[(0,m.jsx)(f,{...n,...e}),(0,m.jsx)(v,{...n,...e})]})}function A(e){const n=(0,g.A)();return(0,m.jsx)(y,{...e,children:d(e.children)},String(n))}},4039:(e,n,t)=>{t.d(n,{A:()=>l});const l=t.p+"assets/images/install_1-ecb42d3c5d1d88f0ad9e28c3d2329f4d.png"},3980:(e,n,t)=>{t.d(n,{A:()=>l});const l=t.p+"assets/images/install_2-e8775051ce9dc867327ecb5c2518b075.png"},3077:(e,n,t)=>{t.d(n,{A:()=>l});const l=t.p+"assets/images/install_3-9188b402989172bb1b3ad59c63019a39.png"},6570:(e,n,t)=>{t.d(n,{A:()=>l});const l=t.p+"assets/images/install_4-fc2b785ae41499c466ce058416a82eeb.png"},8453:(e,n,t)=>{t.d(n,{R:()=>i,x:()=>a});var l=t(6540);const r={},s=l.createContext(r);function i(e){const n=l.useContext(s);return l.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:i(e.components),l.createElement(s.Provider,{value:n},e.children)}}}]);