zhenxun_bot/install/index.html
2021-10-13 13:27:17 +08:00

56 lines
11 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>安装指南 | 真寻Bot</title>
<meta name="generator" content="VuePress 1.8.2">
<link rel="icon" href="/zhenxun_bot/favicon.ico">
<meta name="description" content="非常可爱的多功能机器人!">
<link rel="preload" href="/zhenxun_bot/assets/css/0.styles.c2e9a96f.css" as="style"><link rel="preload" href="/zhenxun_bot/assets/js/app.6e26ea20.js" as="script"><link rel="preload" href="/zhenxun_bot/assets/js/2.37ad9f3c.js" as="script"><link rel="preload" href="/zhenxun_bot/assets/js/9.d8b8697d.js" as="script"><link rel="prefetch" href="/zhenxun_bot/assets/js/10.08b3afb2.js"><link rel="prefetch" href="/zhenxun_bot/assets/js/3.d8535281.js"><link rel="prefetch" href="/zhenxun_bot/assets/js/4.920e727c.js"><link rel="prefetch" href="/zhenxun_bot/assets/js/5.f5eec935.js"><link rel="prefetch" href="/zhenxun_bot/assets/js/6.d0ea70c3.js"><link rel="prefetch" href="/zhenxun_bot/assets/js/7.3546aebd.js"><link rel="prefetch" href="/zhenxun_bot/assets/js/8.ee7f7f94.js">
<link rel="stylesheet" href="/zhenxun_bot/assets/css/0.styles.c2e9a96f.css">
</head>
<body>
<div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/zhenxun_bot/" class="home-link router-link-active"><!----> <span class="site-name">真寻Bot</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="/zhenxun_bot/" class="nav-link">
主页
</a></div><div class="nav-item"><a href="/zhenxun_bot/install/" aria-current="page" class="nav-link router-link-exact-active router-link-active">
指南
</a></div><div class="nav-item"><a href="/zhenxun_bot/help/" class="nav-link">
帮助
</a></div><div class="nav-item"><a href="/zhenxun_bot/updatalogs/" class="nav-link">
更新日志
</a></div><div class="nav-item"><a href="https://github.com/HibiKier/zhenxun_bot" target="_blank" rel="noopener noreferrer" class="nav-link external">
Github Page
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div> <!----></nav></div></header> <div class="sidebar-mask"></div> <aside class="sidebar"><nav class="nav-links"><div class="nav-item"><a href="/zhenxun_bot/" class="nav-link">
主页
</a></div><div class="nav-item"><a href="/zhenxun_bot/install/" aria-current="page" class="nav-link router-link-exact-active router-link-active">
指南
</a></div><div class="nav-item"><a href="/zhenxun_bot/help/" class="nav-link">
帮助
</a></div><div class="nav-item"><a href="/zhenxun_bot/updatalogs/" class="nav-link">
更新日志
</a></div><div class="nav-item"><a href="https://github.com/HibiKier/zhenxun_bot" target="_blank" rel="noopener noreferrer" class="nav-link external">
Github Page
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div> <!----></nav> <ul class="sidebar-links"><li><section class="sidebar-group depth-0"><p class="sidebar-heading open"><span>安装指南</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/zhenxun_bot/install/#安装指南" class="sidebar-link">安装指南</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/zhenxun_bot/install/#前置" class="sidebar-link">前置</a></li><li class="sidebar-sub-header"><a href="/zhenxun_bot/install/#安装" class="sidebar-link">安装</a></li><li class="sidebar-sub-header"><a href="/zhenxun_bot/install/#设置" class="sidebar-link">设置</a></li><li class="sidebar-sub-header"><a href="/zhenxun_bot/install/#运行" class="sidebar-link">运行</a></li></ul></li></ul></section></li></ul> </aside> <main class="page"> <div class="theme-default-content content__default"><h2 id="安装指南"><a href="#安装指南" class="header-anchor">#</a> <strong>安装指南</strong></h2> <blockquote><p>更新于2021/10/13</p></blockquote> <h3 id="前置"><a href="#前置" class="header-anchor">#</a> 前置</h3> <div class="custom-block tip"><p class="custom-block-title">提示</p> <p>由于此项目基于 Nonebot2 和 go-cqhttp 开发所以在开始前您需要完成对go-cqhttp的安装和配置</p></div> <p><strong>go-cqhttp的安装请参照 <a href="https://docs.go-cqhttp.org/guide/quick_start.html" target="_blank" rel="noopener noreferrer">go-cqhttp 文档<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></strong></p> <hr> <h3 id="安装"><a href="#安装" class="header-anchor">#</a> 安装</h3> <h4 id="将项目-clone-到本地-默认为最新版本"><a href="#将项目-clone-到本地-默认为最新版本" class="header-anchor">#</a> 将项目 Clone 到本地(默认为最新版本)</h4> <div class="language- extra-class"><pre class="language-text"><code>git clone https://github.com/HibiKier/zhenxun_bot.git
</code></pre></div><h4 id="进入-zhenxun-bot-目录"><a href="#进入-zhenxun-bot-目录" class="header-anchor">#</a> 进入 zhenxun_bot 目录</h4> <div class="language- extra-class"><pre class="language-text"><code>cd zhenxun_bot
</code></pre></div><h4 id="安装依赖"><a href="#安装依赖" class="header-anchor">#</a> 安装依赖</h4> <div class="custom-block danger"><p class="custom-block-title">注意!</p> <p>请确保您当前的Python版本大于或等于3.8.*</p></div> <div class="language- extra-class"><pre class="language-text"><code>pip install -r requirements.txt
</code></pre></div><h4 id="安装数据库"><a href="#安装数据库" class="header-anchor">#</a> 安装数据库</h4> <div class="custom-block tip"><p class="custom-block-title">提示</p> <p>此项目以 PostgreSQL 作为数据库,所以您还需要安装 PostgreSQL。</p></div> <p><strong>安装过程在此不展示,请自行安装。</strong></p> <h3 id="设置"><a href="#设置" class="header-anchor">#</a> 设置</h3> <h4 id="管理员"><a href="#管理员" class="header-anchor">#</a> 管理员</h4> <p><strong>在.env.dev文件中</strong></p> <div class="language- extra-class"><pre class="language-text"><code>SUPERUSERS = [&quot;&quot;] # 填写你的QQ
</code></pre></div><h4 id="api和数据库"><a href="#api和数据库" class="header-anchor">#</a> API和数据库</h4> <p><strong>在configs/config.py文件中</strong></p> <div class="language-js extra-class"><pre class="language-js"><code># <span class="token constant">API</span> <span class="token constant">KEY</span>
<span class="token constant">ALAPI_TOKEN</span><span class="token operator">:</span> str <span class="token operator">=</span> <span class="token string">&quot;&quot;</span> <span class="token comment">//#获取ALAPI https://admin.alapi.cn/user/login</span>
# 数据库(必要)
# 如填写bind则不需要再填写后面的字段#
bind<span class="token operator">:</span> str <span class="token operator">=</span> <span class="token string">&quot;&quot;</span> <span class="token comment">//# 数据库连接链接 示例:&quot;bind&quot;: &quot;postgresql://user:password@127.0.0.1:5432/database&quot;</span>
sql_name<span class="token operator">:</span> str <span class="token operator">=</span> <span class="token string">&quot;postgresql&quot;</span> <span class="token comment">//# 数据库类型 当前仅支持 PostgreSQL</span>
user<span class="token operator">:</span> str <span class="token operator">=</span> <span class="token string">&quot;&quot;</span> <span class="token comment">//# 数据用户名</span>
password<span class="token operator">:</span> str <span class="token operator">=</span> <span class="token string">&quot;&quot;</span> <span class="token comment">//# 数据库密码</span>
address<span class="token operator">:</span> str <span class="token operator">=</span> <span class="token string">&quot;&quot;</span> <span class="token comment">//# 数据库地址</span>
port<span class="token operator">:</span> str <span class="token operator">=</span> <span class="token string">&quot;&quot;</span> <span class="token comment">//# 数据库端口</span>
database<span class="token operator">:</span> str <span class="token operator">=</span> <span class="token string">&quot;&quot;</span> <span class="token comment">//# 数据库名称</span>
</code></pre></div><h3 id="运行"><a href="#运行" class="header-anchor">#</a> 运行</h3> <div class="language- extra-class"><pre class="language-text"><code>python bot.py
</code></pre></div></div> <footer class="page-edit"><!----> <!----></footer> <!----> </main></div><div class="global-ui"></div></div>
<script src="/zhenxun_bot/assets/js/app.6e26ea20.js" defer></script><script src="/zhenxun_bot/assets/js/2.37ad9f3c.js" defer></script><script src="/zhenxun_bot/assets/js/9.d8b8697d.js" defer></script>
</body>
</html>